This is the repository for the Obojobo Next documentation (View the current docs at https://ucfopen.github.io/Obojobo-Docs/).
Our documentation is versioned and built using Jekyll.
The actual markdown content for the releases are versioned and located in the /releases
directory. Since Jekyll does not support versioning natively, our system of versioning is explained here. Here's an example of the project's file structure:
Obojobo-Docs/
...
docs/
releases/
v3.3.2/
v3.3.3/
...
latest/
./docs/
contains the output files. ./releases/
contains the versioned source files.
./releases/latest/
is a copy of the files inside the most recent version (in this example, 3.3.3), except each file contains a redirect to the file in the most recent version. This creates a URL to the latest version of a file. In the example above, if a file ./releases/v3.3.3/some-page.md
exists, a redirect-only version of that file will be placed in ./releases/latest/some-page.md
. When the docs are built the URL http://.../releases/latest/some-page
will redirect to http://.../releases/v3.3.3/some-page
.
Note:
./releases/latest
only creates redirects for files in the newest version - it will not create a redirect for any files that only exist in an older version. For example, if./releases/v3.3.2/example.md
exists but./releases/v3.3.3/example.md
does not then no redirect will exist in./releases/latest
.
The
./releases/latest
directory is not required as the latest redirects are created automatically.
bundle install --path vendor/bundle
bundle exec rake dev_latest_version
The files in the highest numbered release
directory will auto-update in your browser when they are modified.
This command is faster to run as Jekyll does not need to update all the files across several versions.
bundle exec rake dev_version["VERSION_NUMBER"]
bundle exec rake dev_version["5.6.7"]
)The files in the release
directory for the given version will auto-update in your browser when they are modified.
This command is faster to run as Jekyll does not need to update all the files across several versions.
bundle exec rake dev
The files in the ./releases
directory will auto-update in your browser when they are modified.
This command can be slow to run depending on the number of release versions in the repository!
Use the version selector drop-down on a documentation page to switch between versions. Note that this selector is only aware of the list of versions in ./releases
and may result in a 404 if the current file does not exist in the newly selected version.
bundle exec rake releases:new_version["VERSION_NUMBER"]
bundle exec rake releases:new_version["5.6.7"]
This creates a new latest version from the previous latest version (by copying files from the previous latest version).
If you need to create a new release from a specific older version (instead of the current latest version) see Creating a new release from a specific version below
obo_node
{{ 'ActionButton' | obo_node }}
[ActionButton]("http://.../obo_nodes/action_button.html")
menu_titles
{% assign titles = site.menus.chunks | menu_titles %}
["ActionButton", "Assessment", "Assessment > rubric", ...]
page_titles
{% assign titles = site.pages | page_titles %}
["ActionButton", "Assessment", "Assessment > rubric", ...]
obo_node_names_for_version
page.docs_version
). The filtered array is unique and sorted.{% assign names = titles | obo_node_names_for_version %}
["ActionButton", "Assessment", "Assessment > rubric", ...]
Note: If you manually iterate over
site.menus.chunks
to get a list of Obojobo chunk nodes (for example) you may get duplicate entries since the Jekyll Menus plugin will find menu items in all release versions. This filter is provided to mitigate this issue as it will produce a unique list of items only for the current version.
obo_nodes_that_can_be_in_a_question.md
can_be_in_a_question
to true
.{% include obo_nodes_that_can_be_in_a_question.md %}
"[ActionButton]("http://.../obo_nodes/action_button.html"), [Break]("http://.../obo_nodes/break.html"), ..."
page.docs_versions
{{ page.docs_versions | join: "," }}
["3.3.2", "9.8.7"]
page.docs_version
{{ page.docs_version }}
"3.3.2"
page.docs_versions_page_urls
{% for url in page.docs_versions_page_urls %} ... {% endfor %}
{ "3.3.2" => "http://.../releases/v3.3.2/this-page", ... }
Note: This variable is generated simply by getting a list of the version directories in
./releases
and changing the page URL to point to those versions. Not every generated URL is guaranteed to exist and may result in a 404 error.
page.latest_url
[Latest version]({{ page.latest_url }})
"http://.../releases/v9.8.7/this-page"
Note: This variable is generated simply by getting a list of the version directories in
./releases
and changing the page URL to point to those versions. Not every generated URL is guaranteed to exist and may result in a 404 error.
page.latest_docs_version
{{ page.latest_docs_version }}
"9.8.7"
page.is_latest_docs_version
{% if page.is_latest_docs_version %} ... {% endif %}
true
page.is_older_docs_version
{% if page.is_older_docs_version %} ... {% endif %}
false
Docs on the master branch are built and published automatically via GitHub actions.
These commands are probably not as vital as those above but are provided here for reference
bundle exec rake releases:list
bundle exec rake releases:create["SOURCE_VERSION","DESTINATION_VERSION"]
bundle exec rake releases:create["3.3.2","3.3.3"]
This will create a new directory for the destination version based on the source version. In the example this copies the contents of ./releases/v3.3.2
to ./releases/v3.3.3
.
If you are creating a release from the latest version you can use
bundle exec rake releases:new_version
instead.
bundle exec rake releases:delete["RELEASE_VERSION"]
bundle exec rake releases:delete["3.3.3"]
Deletes all source files for the given version. In this example this command would delete the ./releases/v3.3.3
folder.
bundle exec rake test
- This will run the HTML Proofer on the content and return any errors (such as bad links).