While we will continue to deliver the Anthology Developer Documentation via this GitHub repo, we are dropping the use of Jekykll for generating the static files delivered through GitHub Pages. Instead we will be using Docusaurus 2, a modern static website generator.
With this move to Docusaurus we are adding full site search capability and looking forward to using the rich features of Docusaurus and React to improve our Developer documentation experience.
When creating new documentation using MD, please copy and paste the layout within /docs/templates/example.md
since that includes two additional trackers that will show information or add the following tags to the top and bottom of your page respectively:
---
Metadata
---
<VersioningTracker frontMatter="{frontMatter}" />
Your content goes here
<AuthorBox frontMatter="{frontMatter}" />
Please also make sure to fill out the metadata at the top of the page with the appropriate information
- Clone this repo
$ cd
to the project directory$ npm install
to install project dependencies$ npm run start
to run the Docusaurus site locally - it will open in your browser- Edit your pages and the site will update automatically on save
- When you think you are done before you do a pull request test the build...
$ npm run build
to build the site locally. The great thing here is everything gets tested and if the build fails you will know... if it fails - fix it and rinse/repeat step 7 until it succeeds, then move onto step 8.$ npm run serve
to locally serve the static build of the site - if your changes look good carry on to step 9, otherwise back to step 4 (that is faster than doing a full build for each possible test cycle), make your changes, and run through steps 5-8.- Do a PR with your changes...
- When you submit your PR an automated test is run. If the test fails it shows as failed on the PR. If it is successful, and we approve the changes requested then we will merge. The test takes about 2.5 minutes. If you have merge privileges please wait until a successful test completes before attempting the merge. Allow for the merge test to complete before deleting your branch.
- When merged an auto-build takes place generating the static files for the docs.anthology.com pages site. The auto-build takes about 2 minutes.
- After step 9.ii is complete, the pages-build-deploy action is run which copies the static pages file to github pages. The build-deploy takes about 2 minutes.
- in 1-5 minutes the site is refreshed and delivering your new content.
- TEST the site before claiming your ribbon!
Due to the static nature of the UEF Documentation and that Docusaurus cannot display this via the SPA, we must place the UEF Documentation in the static uef-documentation
directory.
It will now open in a separate tab.
Additionally, the uef-documentation may require some additional changes in order for Docusaurus to properly display the html.
- anchor links
- These are currently
<a href="<filename.html>#<anchor>">
and need to be changed to<a href="#<anchor>">
- Fix this using VSCode regular expression search\replace
.*
:- find:
"([a-zA-Z\.]*)html#
- replace:
"#
- find:
- Fix this using VSCode regular expression search\replace
- Also there is no back to the Getting Started page (uef-documentation/index.html)
- Fix this using VSCode search\replace:
- find:
<nav class="tsd-navigation primary"> <ul> <li class="label"><span>Pages</span>
- replace:
Now all pages will have a link back to the documentation index page.<nav class="tsd-navigation primary"> <ul> <li class="globals "> <span><a href="../start.html" >Getting Started</a></span> </li > </ul > </nav > <nav class="tsd-navigation primary"> <ul> <li class="label"><span>Pages</span>
- Fix this using VSCode search\replace:
- These are currently
FIXED by adding
cname: docs.anthology.com
to deploy.yml build script. Leaving below here "just in case".
Problem: For some reason sometimes on a PR build Pages resets the site URL from docs.anthology.com back to https://blackboard.github.io/anthologydevdocs/
- no idea why at this time.
Solution:
- Reset custom domain back to docs.anthology.com if necessary. Proceed to step three below.
- If that doesn't fix it then:
- Go to settings>pages and unpublish
- Re-run the pages-build-deployment action
- Reset custom domain back to docs.anthology.com if necessary. Proceed to step three below.
- Wait for DNS check to complete and then test by going to https://docs.anthology.com
Generally markdown links work fine in Docusaurus with the following exceptions:
- Blog to Docs or Docs to Blog links: There is an 'issue' where md is not translated cross plugins (blogs and docs are delivered via plugins)
- Links containing Anchors:
For both 1 and 2 use HTML href tags. For 1 use the full URL and add target="_top"
to open the link in the same browser tab. e.g.: <a href="https://docs.anthology.com/docs/path-to-file" target="_top">open doc from blog</a>
In cases where you are using anchor tags with your links - these will not render correctly in developer mode. You have to $ npm run clear; npm run build; npm run serve
to test.
Docusaurus provides a complete reference for using links in markdown in Docusaurus.
important: Please remember to change any http://localhost:3000 local developer/build links to production links https://docs.anthology.com before your PR.
Docusaurus is not as forgiving re table markdown - fiddle with spacing at the header level or ride the HTML wave.