CellProfiler / tutorials

CellProfiler tutorial pipelines and images
https://tutorials.cellprofiler.org/
BSD 3-Clause "New" or "Revised" License
81 stars 87 forks source link

Finish modernization of the tutorials repo #53

Open bethac07 opened 8 months ago

bethac07 commented 8 months ago

The easiest way to take advantage of the translation workflow we've ported over from bioimagingguide is to rather than build tutorials how we have been up until now (pandoc), we build them with Sphinx, where we can build either version with just a single flag switch. We can also bulk-build whole folders, and even easily make it so that you can access all the tutorials in a single page (this to me is the critical thing that keeps this from being an overengineering exercise). There are plugins we can use (see link and alternatives mentioned in it) to then also automate the PDF building, if we want. I'd love to eventually get to a place where we just make text edits in the markdown file, and then each tutorial builds itself in however many languages we support, makes the right zip files, puts them somewhere, etc, so all we need to do is worry about content and the rest takes care of itself. That might be a fun beginner-intro-to-GH-and-builds project.

Unfortunately a) we did not always structure things in a way that makes bulk-building a single file a great idea (some things have multiple top-row headings, for example) and b) Sphinx seems to take issue with the way we embed images sometimes for RST, etc. Fighting with RST at least preliminarily hasn't gone well, but since Sphinx supports MyST, which we know is super full-featured, this could be a better option.

So a few annoying things will need to get done, but for hopefully results we agree are worth it!

Once - short term

Per current tutorial - short term Go through and fix up. This includes

Eventually

bethac07 commented 8 months ago

Once all the short term action items are done, we'll pull 54

emiglietta commented 6 months ago

When making the .html files, the images inserted in line with the text don't show properly image

Although in the preview of VS Code, they appear normally: image

bethac07 commented 6 months ago

Whoops, forgot to enable that, just need to add it to the conf

diff --git a/internal_use/docs/source/conf.py b/internal_use/docs/source/conf.py
index 41ef378..35fd9e7 100644
--- a/internal_use/docs/source/conf.py
+++ b/internal_use/docs/source/conf.py
@@ -29,7 +29,7 @@ author = 'Imaging Platform'
 # ones.
 extensions = ['sphinx.ext.intersphinx', 'myst_parser']
 locale_dirs = ['../locale/']
-myst_enable_extensions = ['colon_fence', 'dollarmath', 'linkify', 'substitution', 'tasklist']
+myst_enable_extensions = ['colon_fence', 'dollarmath', 'linkify', 'substitution', 'tasklist', 'html_image']
bethac07 commented 6 months ago

Other option would be to use the attrs_inline,but you'll still need to add that to the conf, so this seems simpler for now

https://myst-parser.readthedocs.io/en/latest/syntax/images_and_figures.html#inline-images

emiglietta commented 6 months ago

Done! now inline images are display correctly!

emiglietta commented 6 months ago

I put the instructions in internal-use/docs/instructions.md

bethac07 commented 5 months ago

Nice, exciting we got this merged! A couple cleanup tasks outstanding:

emiglietta commented 5 months ago

sounds good! just one question, all these modifications should be done in the Build modernization branch? Also, should we delete the BS_simplification branch? since it is already merged to Build modernization?

bethac07 commented 5 months ago

Both those branches should now get deleted and work on #2 should start from a new clean branch! The first one will happen only in Transifex so no GH changes needed at this time.