[not sure if this a Sphinx or a Pygments question; I'll start here] I'm trying to find a good approach to worksheets for beginner-friendly [mostly kid-friendly] Coding Dojos. I'm using Sphinx with some literalincludes interspersed to show the code the participants should be writing / working from. Example here:
http://wall-ball.readthedocs.io/en/latest/steps/step01.html Obviously I'm trying for a progressive-enhancement approach: each step or sub-step builds on the previous one and produces a visible result with not too many lines of code. What I want is something like literalinclude diff option but highlighting the changed lines rather than rendering a unified diff. I've cloned the literalinclude logic to produce a literaldiff extension directive and the approach looks like it's going to work: tweak the "diff" logic to return the raw Differ.compare output and then build the "emphasize-lines" lineset from that. At this point I seem to be at the point where Sphinx & Pygments touch. At present, Sphinx simply hands off to Pygments and says "highlight those lines". I'm using a customised theme so I can tweak the CSS for the highlighted lines. But what I'd like is to have removed lines highlighted in one way (say: strikeout) with added lines highlighted another way, and updated differently again. So... should I be trying to implement a Pygments lexer to render my mini-language how I want? Or is there some way from within Sphinx that I can tweak the output directly to add the highlights I want? I'm aware that Pygments has a lexer for the diff format; what I really want, though, is some way to have Python syntax rendering with additional highlighting for the diffed elements. -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sphinx-users. For more options, visit https://groups.google.com/d/optout.
