Comments (7)
The simplest way to get this to work is tagging. I had looked at it at the very beginning (see #3 ; but that is more of a reminder to myself with no details) but my attempts to get tagging to work failed. A lot has changed since then, so it is certainly worth visiting this again.
My understanding of the export mechanism is the following. Once we add tags to any macro (IIRC, it used to \starttagged[name]...\stoptagged
, but I need to check again), then export translates that environment to <name> ... </name>
. The rest (getting linebreaks, highlighting, etc) is simply a matter of adding appropriate CSS code.
from filter.
Hm i couldn't withstand, i was too curious. I have checked documentation and also my first epub output (produced by context MKIV
). And exempt the Tags for \SYNBOL
and \SYNEOL
all other Tags are already mapped to <div>
</div>
properly inside the xhtml. So to get the lines explicitly it should be sufficient to define appropritate TeX macros for \SYNBOL
and \SYNEOL
for the case where linenumbering is not active and extend the ones for linenumbering accordingly to get the tags (guess \dostarttagged
and \dostoptagged
do the magic) expressed inside the xhtml. And than as you say it should be just a matter of css to make the corresponding <div class="syntax line"> </div>
standout as indiviual lines.
Alternatively it should also be possible to simply map \SYNBOL
and \SYNEOL
to a special syntaxgroup called eg "syntax code line" or similar. Than it would only be necessary to call startsyntaxgroup and stopsyntaxgroup from the linenumbering enabled macros. Would that be an option to keep things as simple and minimal as possible or do you see any comlications and flaws with this approach?
from filter.
What i think i have figured is that things have changed less than you expect. The two macros which seem to me to do the magick are \dostarttagged
and \dostoptagged
. The two you have already in the \syntaxgroup
and \syntaxhighlighting
macros, which seem to be the reason why these already appear as tag in the xhtml output as expected. The only ones which do not appear are \SYNBOL
and \SYNEOL
which are either mapped to \donothing
in case line numbering is off or to syntaxhighlighting_begin_number_lines
and \syntaxhighlighting_end_number_lines
which do not call \dostarttagged
and \dostoptagged
.
If you would not mind i would create a new feature branch from dev and try to get the \SYNEOL
and \SYNBOL
macros also call on MKIV
call the \dostarttagged
and \dostoptagged
macros and add to the templates.css the appropriate classdefinition.
In case i would be successufl i would than create agaion a pullrequest for review. Would that be OK for you?
from filter.
from filter.
Giving up.
Managed to get the individual codelines to be individual lines. No colours. Linenumbers on separate empty lines as for typing environment too.
The backend xml/xhtml exporter seems to be still rather rudimentary, proof of concept. Way too many things hardcoded in lua. No chance to hook into it to adjust output accoriding to t-vim typesetting logic (see may mails on context mailing list).
Do you think it would make sense to repost the whole on the ConTeX development list? Or is that just for direct context development
EDIT/UPDATE
Dunno how but i managed to make it work. Space and linenumbering is now displayed as expected if css is tuned a bit. Currently working on generation and linking of css into export. May tage another set of weeks ;-)
Edit/UPDATE
First suggestion see pullrequest #34
from filter.
I think that we got quite far in solving with #34 and #38. Besides the therein identified issues with whitespace removal when typset inside floats and using numberlocation values other than default or left this issue can be considered sort of solved or at least as mostly addressed and handled.
from filter.
Closed by 20544c1
from filter.
Related Issues (20)
- Decide if and how to map style `command` parameter to CSS HOT 5
- Question: Does filter module work with ConTeXtLMTX and can it be used in Windows? HOT 2
- Test 51-colorscheme.tex is failing - both comments in blue color HOT 3
- css path is inserted wrongly HOT 5
- Accents are not displayed when using filter with R HOT 2
- t-vim doesn't appear to set vimrc correctly HOT 4
- Utility of line 172 in 2context.vim HOT 4
- Test 07-indenting is failing
- Dead link in vim-readme HOT 1
- Minimum working example of t-vim HOT 3
- Insufficient coloring of c++ code HOT 7
- numberdistance not considering margin HOT 4
- numbering in conflict with itemize[columns] HOT 1
- t-vim in conflict with setupbodyfont HOT 1
- Vim filter cannot process two files with same name but different extensions
- process LaTeX fragments? HOT 4
- t-vim `.vimout` file name clashing HOT 9
- Using filter twice gives same replaced output HOT 4
- \SYN command causes fuzzy paragraph warnings in xmlexporter HOT 6
- Multichunk processing HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filter.