docs integration
shaunlebron opened this issue · 1 comments
Context: The pipeline for the cljs api docs handles a lot of complexity behind parsing/supplementing API data, and produces a plain data file (see its format here). This should be the only interface between the site and the docs.
Updating the docs should look like:
./update-docs.sh
./publish.sh
The update script should download and read the latest API docs file:
https://github.com/cljsinfo/cljs-api-docs/blob/catalog/cljs-api.edn
It should then generate files in site-jeykll/
after reading the latest docs:
auto-generated
The following files should be generated. All should have a comment at the top describing that it was created by the update script.
_data/docs/history.json
(see data files in jekyll)docs/<fullname>.md
files for symbol pages, containing:- front matter such as symbol or namespace names
- content blocks for markdown content (description and examples)
- symbol references file for simple cross-referencing of symbols
doc-search-index.json
available to JS for dynamic search sidebar
not generated
docs/history.md
- this will render a history table and API changes by using the generated data insite.data.docs.history
_layouts/docs/symbol.md
- symbol pages (setwindow.__cljs_api_doc__.symbol
so sidebar knows what symbol we're in)_layouts/docs/syntax.md
- syntax pages are rendered slightly differentlydocs/index.md
- starting point, using the symbol layout.
sidebar
We need a sidebar for searching/exploring docs that will require some dynamic behavior.
This'll be a clojurescript React component.
On init:
- Check
window.__cljs_api_doc__.symbol
to set current symbol - Check
?search=
to set current query string for search term. - Scroll the sidebar to accomodate current category, symbol, or search result.
Explore mode:
- display category column (highlight current), update current category on click.
- display symbols column (highlight current), navigate to symbol on click.
Search mode:
- if search field has anything, display results instead of category/symbol columns
- display results with highlighted matches
- each result link navigates to its symbol URL appended with
?search=
- this allows the user to still see search results across pages
- Display a
full search >
link to navigate to a future page showing more details of each result
gone a different direction. ditched jekyll, and will have to forgo search until later