Skip to content
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

Formulate learning goals at top of each topic. #83

Open
timosachsenberg opened this issue Jun 10, 2021 · 15 comments
Open

Formulate learning goals at top of each topic. #83

timosachsenberg opened this issue Jun 10, 2021 · 15 comments

Comments

@timosachsenberg
Copy link
Contributor

Maybe in a colored box e.g. something like

In this section, you will learn:

  • how to load, process and store mass spectra and chromatograms
  • how to plot spectra
@enetz
Copy link
Contributor

enetz commented Oct 22, 2021

I tried to see what options there are, and it seems making random colored boxes with rst is not trivial.
To keep it simple, we can use the "Note" boxes or just an indented list. We don't use those note boxes very often yet.
Here is an example how these two options would look like:

pyOpenMS_dec_goals

@timosachsenberg
Copy link
Contributor Author

I think the note boxes don’t look bad

@jpfeuffer
Copy link
Contributor

Can you try admonition?
https://labs.bilimedtech.com/workshops/rst/writing-rst-3.html

We also have to check if it is correctly converted to ipynb.

@enetz
Copy link
Contributor

enetz commented Oct 25, 2021

@jpfeuffer thanks for that link! I tried to find a way to define custom admonitions, but couldn't find an example before, so I tried the Note default.

@enetz
Copy link
Contributor

enetz commented Oct 25, 2021

also about jupyter compatibility, I didn't expect this, using binder:

It turns into simple plain text with Note above (example from a page where a Note was already used before),
although jupyter supports the same admonitions, just with a slightly different syntax.
It looks like it should be trivial to translate: https://jupyterbook.org/content/content-blocks.html

jupyter_note

@jpfeuffer
Copy link
Contributor

Yes.. unfortunately not supported by pandoc:
jgm/pandoc#2610

We would need a custom filter.

@timosachsenberg
Copy link
Contributor Author

if it is only about the learning goals I think we could also go with the special ignore tag for binder?

@jpfeuffer
Copy link
Contributor

jpfeuffer commented Oct 25, 2021

I quickly hacked another pandoc filter:

#!/usr/bin/env python

"""
Pandoc filter to convert divs with class="admonition" to ipynb
"""

import sys
from pandocfilters import toJSONFilter, RawBlock, Div, stringify


def html(x):
    return RawBlock('html', x)


def admonitions(key, value, format, meta):
    if key == 'Div':
        [[ident, classes, kvs], contents] = value
        if "admonition" in classes and format == "ipynb":
            newcontents = [html('<div style="background-color: #BDE5F8; margin: 10px 0px; padding:12px;"><p><i class="fa fa-info-circle"></i> <b>' + stringify(contents[0]) + '</b></p>')] + contents[1:] + [html('</div>')]
            return Div([ident, classes, kvs], newcontents)
        elif "note" in classes and format == "ipynb":
            newcontents = [html('<div style="background-color: #BDE5F8; margin: 10px 0px; padding:12px;"><p><i class="fa fa-info-circle"></i> <b>Note:</b></p>')] + contents + [html('</div>')]
            return Div([ident, classes, kvs], newcontents)

if __name__ == "__main__":
    toJSONFilter(admonitions)

@jpfeuffer
Copy link
Contributor

But not sure how well that works with nestedness.

@jpfeuffer
Copy link
Contributor

By the way, I could not make the admonitions work without HTML in binder. I don't think it supports the full jupyterBOOK format.

@jpfeuffer
Copy link
Contributor

filter was included in #212

@tapaswenipathak
Copy link
Contributor

What are the remaining documentation todos?

@jpfeuffer
Copy link
Contributor

Add learning goals to top of every "applied"/tutorial section of the pyopenms and maybe also the new openms docs.

@timosachsenberg
Copy link
Contributor Author

any update here from last sprint?

@KyowonJeong
Copy link
Contributor

Yes. I studied how to put this box and tried a few things. I will try to put this box in each algorithm section by the next week.

@KyowonJeong KyowonJeong moved this from Todo to In Progress in Jan 8 - Jan 22 Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Status: Todo
Development

No branches or pull requests

5 participants