Skip to content

Commit 7cdc7d5

Browse files
authored
Add tagfiles to support fetching documentation with xeus-cpp-lite (#2862)
Hi, We can currently fetch the standard documentation through xeus-cpp-lite. But we can't yet cover any 3rd party lib. 1) Xeus-cling could fetch xtensor documentation (even without xtensor being installed, because the tagfiles were added to xeus-cling themselves. Check [here](https://github.com/jupyter-xeus/xeus-cling/blob/main/share/xeus-cling/tagfiles/xtensor.tag)) . This doesn't sound justified. 2) As discussed with Sylvain in the past, we probably shouldn't populate xeus-cpp with the tagfiles for all repos but rather have them be a part of the repo itself. And then when we do a mamba install %xtensor, these end up in the file system and then can be put to use from there. Something like <img width="1528" height="418" alt="image" src="https://github.com/user-attachments/assets/012d4c8b-f757-4120-821d-eca6a60a2c52" />
1 parent c7ae1a6 commit 7cdc7d5

File tree

5 files changed

+1361
-1
lines changed

5 files changed

+1361
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,6 @@ __pycache__
6363
# Generated files
6464
*.pc
6565
.vscode/settings.json
66+
67+
# Allow tag JSONs under etc/xeus-cpp
68+
!etc/xeus-cpp/tags.d/

CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ project(xtensor CXX)
1212

1313
set(XTENSOR_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
1414

15+
# xtensor tag files
16+
set(XTENSOR_DATA_DIR "share/xeus-cpp")
17+
set(XTENSOR_TAGFILES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/share/xeus-cpp/tagfiles)
18+
19+
set(XTENSOR_CONF_DIR "etc/xeus-cpp")
20+
set(XTENSOR_TAGCONFS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/etc/xeus-cpp/tags.d)
21+
22+
file(COPY "${XTENSOR_TAGFILES_DIR}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/share/xeus-cpp")
23+
file(COPY "${XTENSOR_TAGCONFS_DIR}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/etc/xeus-cpp")
24+
25+
1526
# Versionning
1627
# ===========
1728

@@ -290,6 +301,12 @@ configure_file(${PROJECT_NAME}.pc.in
290301
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
291302
DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig/")
292303

304+
install(DIRECTORY ${XTENSOR_TAGFILES_DIR}
305+
DESTINATION ${XTENSOR_DATA_DIR})
306+
307+
install(DIRECTORY ${XTENSOR_TAGCONFS_DIR}
308+
DESTINATION ${XTENSOR_CONF_DIR})
309+
293310
# Write single include
294311
# ====================
295312

docs/source/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Changelog
2626
`# 2848 https://github.com/xtensor-stack/xtensor/pull/2848`
2727
- Revive benchmarks
2828
`# 2854 https://github.com/xtensor-stack/xtensor/pull/2854`
29-
- Set cmake min version to represent used features.
29+
- Set cmake min version to represent used features.
3030
`# 2852 https://github.com/xtensor-stack/xtensor/pull/2852`
3131
- Enabling rich display for xeus-cpp-lite
3232
`# 2853 https://github.com/xtensor-stack/xtensor/pull/2853`

etc/xeus-cpp/tags.d/xtensor.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"tagfile": "xtensor.tag",
3+
"url": "https://xtensor.readthedocs.io/en/latest/"
4+
}

0 commit comments

Comments
 (0)