Closed BoPeng closed 7 years ago
We could also use gists to provide examples once we move our documentation to bopeng.github.io/sos
.
Great move! Should we consider HUGO? https://gohugo.io/overview/introduction/
HUGO supports markdown, which makes things a lot easier, but I am not sure if its format is as limited as github markdown. Also, my biggest concern is syntax highlighting, namely if it uses codemirror or pygments so that we can syntax highlight our examples.
Gist can be a good idea for examples because we can edit them externally, but it does not support syntax highlighting of sos code.
EDIT: I see hogo supports pygments but not sure if it accepts our pygment extension for sos.
Another requirement would be easy to use navigation, because the github wiki side bar is not very helpful.
HOGO side bar looks great. I think it should also support mixture of MD and HTML so if we compile SoS script into HTML and plug into the MD (maybe streamline it via some scripts) we should be good.
Another option is jeklly which interacts nicely with github pages.
The homepage also need to be a bit more modern looking (e.g. http://immatics.com/), with icon, definition in large font, less text and more picture and youtube video.... Perhaps I should ask for some professional help.
Professional help 👍 My hope is that we do not have to give up on MD for the source part.
Jun tried to create the doc using jekyll, https://jma7.github.io/sos_wiki/ . Missing pieces include
For home page, I would like to have a HUGO style homepage with
LARGE LOGO/ BANNER
-----------
several icons, links to doc, download, example etc
------------
three side by side videos for
[file format] [interactive] [workflow]
--------------
file format summary, and example
---------------
interactive use summary and example
--------------
workflow use summary and example
---------------
other information.
I tried to add the pygments into jekyll, which seems working fine on my desktop, please take a look at http://10.105.38.239/SOS/ This is running on my desktop. The keywords in SOS are highlighted.
However when I push the gh-pages branch to SOS github, I get the message with this link: https://help.github.com/articles/page-build-failed-config-file-error/#fixing-highlighting-errors So it seems pygments is not the supported highlighter on github.io. The supported highlighter is rouge, so maybe add SOS lexer to rouge? Right now, the markdown file at http://bopeng.github.io/SOS/ are using python style.
Just keep a record here, steps to add custom pygments file into jekyll.
So we cannot use syntax highlighting unless we learn some ruby? The 'spawn a process slowness' criticism to pygments does not stand because github hacked pygments to pygments.rb to make it work on github....
I think the best way to proceed would be giving up markdown with scripts and use ipynb for all documentation with code. All we need is a script to convert ipynb
to html
and publish the html
files to github.io.
Another possibility is to find a md to html converter and convert our markdown files to HTML using pygments before publishing to github.io.
I have converted all markdown docs to ipynb and moved them to doc/
. I suppose we only need a bash file to batch convert them to github.io.
So are we now directly editing docs in Jupyter and save as ipynb, and we'll convert ipynb to HTML to post online? For example if I am to make changes, should I work directly on the ipynb? This format is less transparent than markdown. I just worry trivial changes such as cell number (not the contents) will trigger in ipynb file update; or do we still have some markdown version and we convert to ipynb from markdown via some command? Also with HTML generated this way, can we still have sidebar like the HUGO website?
There is no perfect solution as we have found that github.io does not support pygments so there is no easy way to syntax-highlight SoS code in markdown. Also, because of the rapid evolvement of SoS, it is very difficult to keep the documentation up to date in MD format so being able to execute documentation is very important. In the end we decided to use ipynb so that users can run the examples in the documentation directly from the public sos server. The static pages would be converted from ipynb using jupyter nbconvert
.
The jupyter markdown is actually easier to use than github markdown, at least it supports HTML which makes customization a bit easier. The jupyter notebook initially only support forward-style workflow, I have changed it to be highly compatible to the command line version to better demonstrate features of SoS.
To answer your questions:
One trick that I am using is to run "run all" from Jupyter to make sure all cells run correctly. This checks correctness of code and make sure all cells are sequentially numbered.
BTW, there is a toc extension for Jupyter. https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tree/master/src/jupyter_contrib_nbextensions/nbextensions/toc2 , which could help export a TOC during nbconvert.
It is actually pretty cool:
Or go to server_url/nbextensions
, select Table of content, and the notebook would have a "Navigation" menu and you can open a menu panel by clicking an icon.
Thanks to Jun, the ipynb to html process now works like this.
website
.doc
, with subdirectories examples
, documentation
and tutorial
development/release publish
converts documents under doc
to HTML format under the website
directory, pushes the change to master, and pushes the subtree doc
to gh-pages
.Remaining issues:
js/sos_script.js
)website/img
?.ipynb
?How to adjust the font of the homepage? I like the font and layout of http://beakernotebook.com/index, perhaps we can copy some of the ideas?
It is great to have the ipynb to html process streamlined! I'm thinking in our documentation we should make this release
script a good example for people to organize their research -- they analyze data in Jupyter, and release it to gh-pages
for book-keeping and sharing with collaborators.
I volunteer to make this page of doc, as I'm going to learn / adopt this myself anyways. Thanks @jma7 !
Also, should we keep the website HTML and figures only in gh-pages
not in master
? This will keep our main repo cleaner.
Good idea. We have update_toc.sos
under example now, which is obsolete but can still be used as an example. We can put release
over there later.
I just added toc
to the pages, which is actually nice since the toc is float. It would be really nice for us to add a ".." (up, toc) button or a drop down list of all documentations so that we can easily navigate across pages.
Yes if you can figure out some easy way to do that.
The problem is that we need to keep doc in master because they will be included in the notebook docker image. It would be difficult to publish the docs if we have to switch and sync between master and gh-pages. The current setup allows us to do everything in master and publish the website with a single command (./release publish
(perhaps should be renamed to publish_doc
or doc
, and on a related topic perhaps we should allow -
in workflow name)).
The repo is not clustered that much because website
is a subtree that is pushed to gh-pages
. You can think of having master
and gh-pages
both under your hand and feels better about it. :-)
@BoPeng do you think a project whiteboard would help organzing issues? It can add cards, and convert github issues to cards. Issues with tags are good, but organizing via whiteboard may be helpful, too.
https://github.com/BoPeng/SOS/projects/1
Thanks for the clarification to the 2 branches. I'll have to experience with them and see if I can possibly make an improvement :)
Depending on if we can make full use of it. Now that we have three people working on the same project, perhaps it is a good idea to let each other know who is working on what...
Let us try it for a few days.
Can a note be claimed by someone as I am doing it?
It looks we can edit all notes no matter who created it. You can either assign or we can volunteer. For notes I create I just assigned myself via @
Hmm, I like the "convert" to issue function because it allows us to discuss tasks there.
Yes, and you can also do it backwards -- create issue and drag it to the board.
Someone just pointed to me that we do not have to use gh-pages
branch to publish to github.io, as long as we are willing to put the entire website under master/docs
. See under settings
:
So we'll have to rename website
folder to docs
and use other names for the doc. This way we can stick to a single branch as we keep html files there anyways. Not sure if you want to adopt this convention.
Great! This would make things a lot easier for us. Could you make the change on website and development/release
?
I do not mind having raw ipynb
file with the html
file in the same directory so you can simply merge the doc
and website
directories.
Sure, let me do this now -- but the setting requires that you do it on your end. Also you'd want to delete the gh-pages
branch on github. I'll let you know when docs
are renamed
Ok I've updated the repo structure and the release
script. Now:
docs/src
docs/doc
website
to docs
gh-pages
branch is no longer touched@BoPeng please make the change from your settings
to point the website to master/docs
, and delete from the github repo the gh-pages
branch, and see if it works. I did not test the release because I still cannot get toc2
to work properly ... But I think my changes to the release
script is correct.
Done. I will test and update release
if necessary.
@BoPeng This is what I mentioned to you on Tuesday, I read it somewhere.....
Things changed fast. I am almost certain this master/docs business was recent.
I tried this master/docs
out in one of my project. I got an email "Page build failure" because apparently github tried to use jeklly to compile my project. It seems we should create a file called .nojekyll
to avoid it. Just did it.
Just got the same email, and was wondering what to do. Thanks.
@jma7 would you kindly share your hack along with instructions on how to keep TOC on the left side of pages? I'm not able to ensure that so any release from my end would be problematic ...
It should work now by doing ./release update-website, would you please try again.
The github wiki is great for drafting our documentation but at this point we should produce better-looking pages with figures, pop-up examples etc.