-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOCSITE: Reorganise tutorials and add inline solutions #231
Conversation
In the preview you gave it looked great, good work!
Because this hasn't been done yet, I can't see what your changes to the tutorial files themselves are, making reviewing it difficult. I can do a manual diffs between _repos/sel4proj/sel4-tutorials/tutorials/* and Tutorials/*, but that is cumbersome. I used the following diff to build and preview the site locally: diff --git a/Gemfile b/Gemfile
index 9e06a50e54..363f7f04eb 100644
--- a/Gemfile
+++ b/Gemfile
@@ -27,6 +27,7 @@ group :jekyll_plugins do
gem 'jekyll-toc'
gem 'jekyll-redirect-from'
gem 'jekyll-remote-theme'
+ gem "jekyll-sass-converter", "~> 2.0" # TODO: Prevent 3.0 untill sass warnings are fixed
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
diff --git a/_config.yml b/_config.yml
index 65f4b8b9a2..b56c93e493 100644
--- a/_config.yml
+++ b/_config.yml
@@ -129,3 +129,4 @@ exclude:
- assets/css/highlighting/demos
- assets/css/highlighting/tools
- assets/css/highlighting/index.html
+ - Tutorials-old On the http://0.0.0.0:4000/Tutorials/ page, the two blocks on the right don't seem right and point to the wrong url? Maybe they shouldn't always be generated, but only on some pages where it makes sense. The "Tutorials about seL4" page has some broken urls (e.g. "About seL4"), mostly missing the new subdirectories you added for the tutorials, but other pages also have broken links. The "Quick solution" need a bit more margin below them and it would help if the mouse pointer would change when hovering above them, both can be fixed with a small css change. Also, when adding a new CSS rule, remove all existing styles from the HTML. It would be nice if, when clicking on a link in "How to: A quick solutions guide", the Quick solution would be expanded automatically. We can add this in the future, but it will require some Javascript (It needs to check a GET or POST variable and set All in all my first impression is that the new structure is a lot better and makes more sense compared to what we have now. I'll give more detailed feedback later, maybe when the changes are moved to the tutorials repo. |
Thanks!
I suggest waiting to review the tutorials until I've made the changes in the tutorials repo, then you'll be able to see line-by-line diffs.
I have added two new layouts to the Tutorial pages to remove the blocks that don't make sense.
The urls have been fixed.
TBD: Integrate CSS with markdown for quick solutions
TBD: Integrate js with markdown to expand solutions automatically
|
The tutorials have now been updated to fit into the new tutorial structure as per this PR (#231). The new tutorials: seL4/sel4-tutorials#106 A note on using the rewritten docsite (#231): Previous TODOs:
|
d06f44d
to
cd043b6
Compare
(rebased to more easily see the new commits) |
Ok, I've managed to get it working, and before I start reviewing all the small details, it's probably better to start high level:
|
Tutorials/index.md
Outdated
## How to use the tutorials | ||
|
||
Depending on your goals and what you want to do with seL4, we suggest | ||
different paths to follow through the tutorial material. Choose the | ||
most relevant category below and follow the tutorials in the suggested | ||
order. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do think that section and set of paths was useful. We should not remove that completely, just recommend a default path (which the site navigation basically suggests now). There is a lot of useful content overview in here that we could use in the overview page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much of this page has been put into the new Overview and Pathways pages, which describe the tutorials and alternate pathways respectively.
Tutorials/index.md
Outdated
<h2>Categories</h2> | ||
The tutorials are split into a number of broad categories: | ||
|
||
- [About seL4](GettingStarted/about-seL4) and [Getting started with the Microkit tutorial](GettingStarted/microkit) introduce seL4 concepts. | ||
- The [seL4 Kernel tutorials](seL4Kernel/overview.md) are a deep dive into seL4 concepts. | ||
- [MCS](MCS/mcs) introduces seL4 MCS extensions. | ||
- [Dynamic Libraries](DynamicLibraries/dynamic-1) covers the libraries that have been developed for rapidly prototyping systems on seL4. | ||
- [CAmkES](CAmkES/hello-camkes-0) is a platform for building componentised systems for embedded platforms. | ||
- [Microkit](https://trustworthy.systems/projects/microkit/tutorial/)is an operating system framework on top of seL4 provides a small set of simple abstractions that ease the design and implementation of statically structured systems on seL4. (Links to the same tutorial as in the [Getting Started](GettingStarted/microkit) section.) | ||
- [Rust](https://github.com/seL4/rust-sel4) provide crates for supporting the use of Rust in seL4 userspace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not come across this content when I was navigating the new site -- which page does it get rendered to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This page was rendered when the user clicked on "Tutorials." I've now redirected "Tutorials" to overview, and used much of the above content in the overview page.
Tutorials/seL4Kernel/setting-up.md
Outdated
## Docker | ||
To compile and use seL4, it is recommended that you use Docker to isolate the dependencies from your machine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are recommending docker, we don't really need the rest of the page apart from repo
(although I don't know if the virtual machine tutorials actually work under docker). We either should remove the docker section or add some text that makes clear that docker and the rest are two alternatives, and that you need only one of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually removed everything but the repo and docker sections, because there is a whole other page on dependencies https://docs.sel4.systems/projects/buildsystem/host-dependencies.html, should someone need them.
I couldn't get of the virtual machine tutorials working on my silicon mac (but I don't think it's related to Docker at all).
Adding issues here for completeness:
"CAmkES VM: Adding a Linux Guest" uses KVM and I would have needed an alternative for mac.
"CAmkES VM: Cross VM Connectors" breaks using ninja
.
sh.ErrorReturnCode_1:
RAN: /usr/bin/cmake -G Ninja -DTUT_BOARD=pc -DTUT_ARCH=x86_64 -DFORCE_IOMMU=ON -DTUTORIAL_DIR=camkes-vm-crossvmke7jqji2 -C ../projec
STDOUT:
STDERR:
Should I add a note to these tutorials saying the instructions are for Linux only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would be good. We've already had some questions from people who were trying to use other platforms.
Tutorials/seL4Kernel/setting-up.md
Outdated
## Getting a build environment | ||
To get a running build environment for seL4 and Camkes, run: | ||
|
||
```bash | ||
git clone https://github.com/seL4/seL4-CAmkES-L4v-dockerfiles.git | ||
cd seL4-CAmkES-L4v-dockerfiles | ||
make user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are now docker instructions again. They should be in the docker section.
cd043b6
to
ba70bbe
Compare
(have rebased and removed the edits to |
Thanks!
I've removed the "about seL4" and started with "overview" instead
I got the wording from https://docs.sel4.systems/projects/microkit/ In any case, I've removed the GettingStarted page that was dedicated to the Microkit tutorial
In the new "pathways" page (which lists alternative pathways through the tutorials), I have suggested that new developers start with Microkit as a very first step, with the caveat that Microkit hides seL4 mechanisms. Can take it out if you think it's misleading.
Details have now been added.
I removed the wikipedia links and changed "prerequisites" to (the hopefully less scary) "recommended reading"
Went back to the two-column format and put howtos and manual under "Tutorials"
Can you pls give an example? Do you mean links that go from the docsite to the seL4 site, e.g. https://sel4.systems/Info/Docs/seL4-manual-latest.pdf?
Done. I added a "contacts" section to the "Resources" front page, because this page already included links to mailing lists. "Contacts" now has links to mailing lists and forums.
It's been renamed to "Resources." This page had an index page associated with it already. It's a bit verbose, but I mostly left it alone since it wasn't part of this PR. (I added a "forums" section, as described above.) |
Renaming the GettingStarted directory to Resources will break a number of links pointing to the docsite. Repos that will need updating:
While the renaming causes some pain, it may be worth doing since GettingStarted is an inaccurate name. (However it may be outside the scope of this PR.) |
I changed template.py in seL4/sel4-tutorials#106 so that docsite links don't render as going offsite. This still needs further work. While the code works locally, it fails PR checks. |
{% assign tutorials = site.pages | where_exp: 'page', 'page.tutorial' | sort: 'tutorial-order' %} | ||
{% for t in tutorials %} | ||
<li class="{% if page.url == t.url %}active{% endif %}"> | ||
<a class="" href="{{t.url}}">{{t.title}}</a> | ||
<li> | ||
{% endfor %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So instead of a manually maintained index you can achieve the same with adding the category as a YAML header parameter which you query, or use other Jekyll features for collections like these. Perhaps something for the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will need your help with this. The code deleted above was for ordering the tutorials on the old (current) docsite, which was pretty shoddy. I.e. the tutorial ordering made little sense, especially to the newbie.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Jekyll way of doing this would be to make the tutorials a collection, add an ordering property to the YAML front matter and add a sort_by
to the config file to order it by that.
But this only works if all items are files in the repo. If that's not the case, things get more messy and the best solution is less clear. Another downside is that there is no overview of the order and you need to see the rendered result.
For the website I added menu.json to have all metadata and ordering information in one place and used that as input to generate the wanted structure. The main reason I did it that way is to keep all the data compact with submenu support and in one place. It's also a mix of local and remote urls, so I couldn't add the metadata to front matter and I really didn't want to create shim files just for that as that's just messy.
Frankly, docs is a mess: It has all the tutorial shim files in the Tutorials directory which already contain a tutorial-order
property, but it also added _data/projects/sel4-tutorials.yml
. You only need one place to keep metadata.
What was wrong with the old code other than the order? The order can be changed by changing tutorial-order
, it's probably alphabetically sorted by value. Main thing missing is the grouping you added, but that can be solved by adding a new field category
to the first tutorial of each group: If set, generate a new '<li>
'.
Once you know the order, it should also be possible to automatically generate the Next tutorial
links too. Maintaining that manually will be hell and easy to forget when changing the order or adding new tutorials in the future.
You want to keep metadata out of your template code and you don't want the same metadata in multiple places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are additional menu items in the tutorial side bar that are a mix of external links and other pages on the site. It also has non-link section headers. The nicest way would probably be similar to what you did for the main site, with one separate json file that has the structure and a separate tutorials-nav
include.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. Nothing is ever simple. The sel4-tutorials.yml
is currently there to define the "project", which has info that gets rendered on a bunch of overview pages, so we can't just remove it. We can use it to define the order, because it has an ordered list of all tutorial pages, and we can add additional info to each of the entries, but I'm not sure how to add additional info like section headers, external links, and links to other pages.
I guess, we could add another field "nav-section" to each component in there and then another top-level entry with a list of section headers, where each either has a nav section name or directly a list of nav items consisting of text and link. That could work. Not entirely sure I'll have time this afternoon, but I could give this a go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would go for the minimal change: Keep the non-tutorial links hard coded here for now and use the existing tutorial-order
to generate the tutorial part, with a new property to create submenus. And then you can use that to figure out the next tutorial link too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't get that quite working -- a lot of the hard coded part also needs to figure out "next" links, which is then not available as data. I went with something similar to the above, which removes a bit of the duplication (order and description in front matter) with sel4-tutorials.yml. The side bar works out ok, computing a reasonable "next" link did not end up to be very elegant.
Choosing the dict keys slightly differently would remove some of the case distinctions, but the ones prescribed by sel4-tutorials.yml
sounded too nonsensical in the nav bar (name
refers to file name, which I found most confusing in there. I guess display_name
would be usable). The names in sel4-tutorials.yml
are prescribed by other generic code on the site, so we can't tweak that without larger changes.
Anyway, have a look if the current version is acceptable. If not, we can always revert some of this.
I have not yet removed the manual "next" links for comparison. One thing that this brought up is that we have two "Overview" pages, which we should probably avoid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You accidentally committed a conflicted merge, see <<<<<<<
, >>>>>>>
blocks.
085fe03
to
ce0ef6d
Compare
Sorry about that, should now be fixed. Not sure how I managed to miss that one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than some nitpicks, all looks good.
Great, thanks for your review. I believe that all the outstanding issues have now been resolved. |
fbae7e8
to
5fc2d96
Compare
1eb12d5
to
ca010d4
Compare
I get this when I try to build:
|
You need to manually set the right branch in the tutorials repo after it has pulled it, but before it builds it. It's unpleasant, but we're almost there. |
The docsite should really be using a manifest and not just randomly clone things, but one thing at a time. |
Ah yes, thanks. |
This commit should be read together with PR seL4/docs#231 The aim of both PRs was to arrange the tutorial material on the docsite such that it is clear and easy to follow. Inspired by the Rust book https://doc.rust-lang.org/book/, the user can see the chapters in the index on the left, and go straight to the corresponding tutorial sections. Specifically, the updates on the docsite provide: - a streamlined guide to completing the tutorials - a streamlined "setting up your machine" page - a how-to page with solutions to tutorial questions - more organised landing page - The tutorials have been slightly rewritten to correct minor errors and provide inline solutions for readers wishing to understand the material and/or get quick solutions General changes in most files: - Make language and bullet points consistent; and, where required, add headers that can be referred to from how-to page - Add section on how to get tutorial solutions - Add inline tutorial solutions - Where necessary, add note that tutorial requires CapDL Loader, and instructions on how to get it. Specific files: macros.py: Remove help block, which was pointing to a list of contacts and resources. These are accessible via the updated tutorials nav sidebar. Rename get-the-code with the more specific get-the-tutorials. Add definition for accessing a tutorial with completed solutions. template.py: Add code to replace links to docsite (when tutorials are run in the docsite) with relative links. hello-world.md: Add more details on containers, builds and QEMU to ease the user into the tutorials. C Libraries: Generic change for C Libraries in the tutorials repo: C Libraries were previously called Dynamic Libraries, and filenames were dynamic-1 etc. There are now libraries-1 etc. hello-camkes-0.md: Add link to CAmkES tutorial slides camkes-vm-crossvm.md: Add note that tutorial instructions for this tutorial are only for Linux. Signed-off-by: Signed-off-by: Birgit Brecknell <[email protected]> Signed-off-by: Gerwin Klein <[email protected]>
This commit should be read together with PR seL4/docs#231 The aim of both PRs was to arrange the tutorial material on the docsite such that it is clear and easy to follow. Inspired by the Rust book https://doc.rust-lang.org/book/, the user can see the chapters in the index on the left, and go straight to the corresponding tutorial sections. Specifically, the updates on the docsite provide: - a streamlined guide to completing the tutorials - a streamlined "setting up your machine" page - a how-to page with solutions to tutorial questions - more organised landing page - The tutorials have been slightly rewritten to correct minor errors and provide inline solutions for readers wishing to understand the material and/or get quick solutions General changes in most files: - Make language and bullet points consistent; and, where required, add headers that can be referred to from how-to page - Add section on how to get tutorial solutions - Add inline tutorial solutions - Where necessary, add note that tutorial requires CapDL Loader, and instructions on how to get it. Specific files: macros.py: Remove help block, which was pointing to a list of contacts and resources. These are accessible via the updated tutorials nav sidebar. Rename get-the-code with the more specific get-the-tutorials. Add definition for accessing a tutorial with completed solutions. template.py: Add code to replace links to docsite (when tutorials are run in the docsite) with relative links. hello-world.md: Add more details on containers, builds and QEMU to ease the user into the tutorials. C Libraries: Generic change for C Libraries in the tutorials repo: C Libraries were previously called Dynamic Libraries, and filenames were dynamic-1 etc. There are now libraries-1 etc. hello-camkes-0.md: Add link to CAmkES tutorial slides camkes-vm-crossvm.md: Add note that tutorial instructions for this tutorial are only for Linux. Signed-off-by: Signed-off-by: Birgit Brecknell <[email protected]> Signed-off-by: Gerwin Klein <[email protected]>
This commit works in conjunction with the updates in seL4/sel4-tutorials#106. Aim: To arrange the tutorial material such that it is clear and easy to follow. Solution: Inspired by the Rust book https://doc.rust-lang.org/book/, users can see the chapters in the index on the left, and go straight to the sections that they need. Specifically, updated tutorials with: - a streamlined guide to completing the tutorials - a streamlined "setting up your machine" page - a how-to page with solutions to tutorial questions - more organised landing page Changes: - Rename “Getting Started” block to “Resources” since this section of the docsite contains much more than a “Setting up your machine” page. - Change “Get Help” sections to “Contact” - In Make tutorials, filter out index.md; get-the-tutorials.md; how-to.md pathways.md; setting-up.md, which are docsite pages, and not in the tutorials repo - change most tutorial .md files in /Tutorials to layout: tutorial - Rearrange order of tutorials - Add relative links - Add html + css for displaying tutorials sidebar - Add css for displaying solutions - Add layout for tutorials overview page and tutorial pages - Add code to toggle solutions boxes; specifically to open solutions boxes when coming from how-to page - Rewrite landing page to reorder tutorials and include the how-to page, seL4 manual, API reference, Microkit and Rust Specific files: Tutorials/get-the-tutorials.md: - Add steps and code for running the tutorials Tutorials/how-to.md: - Add a quick solutions guide, which provides links to tutorial solutions as quick references for seL4 calls and methods Tutorials/index.md - Add an overview on the tutorials section of the docsite - Remove excessive detail about pathways through the tutorials. A new Tutorials/pathways.md page has been created instead, which follows on from index.md Tutorials/pathways.md - Add recommended pathways through tutorials, depending on development goals Tutorials/setting-up.md - Add simplified setting-up page to ease the user into running seL4 and the tutorials _includes/tutorial.md - Remove old capture paths Signed-off-by: Birgit Brecknell <[email protected]> Signed-off-by: Gerwin Klein <[email protected]>
ca010d4
to
3660182
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now squashed into one commit and ready to go.
This commit should be read together with PR seL4/docs#231 The aim of both PRs was to arrange the tutorial material on the docsite such that it is clear and easy to follow. Inspired by the Rust book https://doc.rust-lang.org/book/, the user can see the chapters in the index on the left, and go straight to the corresponding tutorial sections. Specifically, the updates on the docsite provide: - a streamlined guide to completing the tutorials - a streamlined "setting up your machine" page - a how-to page with solutions to tutorial questions - more organised landing page - The tutorials have been slightly rewritten to correct minor errors and provide inline solutions for readers wishing to understand the material and/or get quick solutions General changes in most files: - Make language and bullet points consistent; and, where required, add headers that can be referred to from how-to page - Add section on how to get tutorial solutions - Add inline tutorial solutions - Where necessary, add note that tutorial requires CapDL Loader, and instructions on how to get it. Specific files: macros.py: Remove help block, which was pointing to a list of contacts and resources. These are accessible via the updated tutorials nav sidebar. Rename get-the-code with the more specific get-the-tutorials. Add definition for accessing a tutorial with completed solutions. template.py: Add code to replace links to docsite (when tutorials are run in the docsite) with relative links. hello-world.md: Add more details on containers, builds and QEMU to ease the user into the tutorials. C Libraries: Generic change for C Libraries in the tutorials repo: C Libraries were previously called Dynamic Libraries, and filenames were dynamic-1 etc. There are now libraries-1 etc. hello-camkes-0.md: Add link to CAmkES tutorial slides camkes-vm-crossvm.md: Add note that tutorial instructions for this tutorial are only for Linux. Signed-off-by: Signed-off-by: Birgit Brecknell <[email protected]> Signed-off-by: Gerwin Klein <[email protected]>
Aim: Arrange the tutorial material such that it is clear and easy to follow
Solution: Inspired by the Rust book https://doc.rust-lang.org/book/, the user can see the chapters in the index on the left, and go straight to the sections that they need
Specifically, updated tutorials with:
To-dos: