Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 21 07:25
    mojavelinux milestoned #3425
  • Sep 21 07:25
    mojavelinux assigned #3425
  • Sep 21 07:25
    mojavelinux closed #3425
  • Sep 20 14:24
    oliviercailloux opened #3426
  • Sep 20 11:06
    lurch opened #3425
  • Sep 20 09:14
    Nadano opened #3424
  • Sep 20 08:15
    ionutSergiuP opened #3423
  • Sep 20 07:20
    mojavelinux edited #3414
  • Sep 19 15:32
    lurch opened #3422
  • Sep 18 07:49
    mojavelinux transferred #3421
  • Sep 18 07:49
    mojavelinux labeled #821
  • Sep 18 07:48
    mojavelinux labeled #3421
  • Sep 18 07:48
    mojavelinux opened #3421
  • Sep 16 10:37
    cirosantilli edited #3420
  • Sep 16 10:37
    cirosantilli edited #3420
  • Sep 16 10:36
    cirosantilli opened #3420
  • Sep 16 08:34
    mojavelinux opened #3419
  • Sep 16 07:51
    Mogztter opened #3418
  • Sep 16 07:34
    mojavelinux closed #3375
  • Sep 16 07:31
    mojavelinux closed #3407
Dan Allen
@mojavelinux
point the stylesheet attribute to your custom stylesheet
bodtx
@bodtx
I've already embedded asciidoctor.css
thx
Dan Allen
@mojavelinux
and it gets used instead of the default
as a last resort, you can customize the converter, but see if that works for you first
bodtx
@bodtx
var attrs = { nofooter: '', stylesheet: 'asciidoctor.css',stylesdir: 'chrome://myfirstext/content/', 'copycss!': '', 'icons': '', 'source-highlighter': 'highlight.js' };
:)
Dan Allen
@mojavelinux
you might want to name it asciidoctor-plus.css ;)
bodtx
@bodtx
yes the new one
@mojavelinux do you know if asciidoctor embedded only theese fonts?:
NOTE
TIP
IMPORTANT
CAUTION
WARNING
bodtx
@bodtx
why is there a double brace at the end of asciidoctor.css:
.show-for-print{display:inherit!important}}
could it be an issue ?
Dan Allen
@mojavelinux
that's closing the @media for print
that's looking great!
you can probably just remove the print styles
bodtx
@bodtx
@mojavelinux On the road https://addons.mozilla.org/fr/firefox/addon/asciidoctor-for-thunderbird/ waiting for validation.
alread some ideas for improuvment
Guillaume Grossetie
@Mogztter
Awesome @bodtx.
I'm late to the party but let me know if you need help with Asciidoctor.js
bodtx
@bodtx
@Mogztter thx, was not easy with the attributes but with a little help, it's working great.
one regret : not able to embed font awesome in the body's mail, seems there is a loading problem with some client. So the work around is to work with images and do a replace tricks:
html.replace(new RegExp("./images/icons/", 'g'), "http://mrte.rc.free.fr/font-awesome-4.7.0PNG/");
eckes
@eckes_twitter
Hm, maybe it’s possible to minify font asome to only include the used glyphs and attach it as a data url?
bodtx
@bodtx
@eckes_twitter you mean minifying dynamically? depending on what is used in the body's mail?
eckes
@eckes_twitter
Statically, there are only a few glyphs used. (I think one of the fonts had a online service to do that).
bodtx
@bodtx
could be an idea of improvment
bodtx
@bodtx

@Mogztter Hi Having a little problem with highlight JS parser, it delete my callouts before runing highlight js:

<pre class="highlightjs highlight"><code class="language-ruby hljs" data-lang="ruby">require 'sinatra' <img src="http://mrte.rc.free.fr/font-awesome-4.7.0PNG/callouts/1.png" alt="1">

after doing: hljs.highlightAuto(myhtmlblock)

<pre class="highlightjs highlight"><code class="language-ruby hljs" data-lang="ruby"><span class="hljs-keyword">require</span> <span class="hljs-string">'sinatra'</span>

any idea to protect my <img tag?

cannot reproduce it with asciidoctor livepreview which is calling
hljs.initHighlightingOnLoad()
Guillaume Grossetie
@Mogztter
Sorry I have no idea why Highlight.js removes the callouts. You should look at the source code of highlight.js to reproduce the behavior of initHighlithingOnLoad
bodtx
@bodtx
ok, I'm on Highlight mailing list also
Guillaume Grossetie
@Mogztter
@mojavelinux do you think it's worth spending time on compiling Rouge using Opal ?
Dan Allen
@mojavelinux
Yes. I think that would certainly be worth the effort. The options for good source highlighters is extremely limited, and that could help since Rouge seems to be one of the better ones.
I still think the best strategy is to find a way to run highlights (not highlight.js, but the one in Atom) in the browser or from node.

Sorry I have no idea why Highlight.js removes the callouts.

This is partially to be expected since highlight.js is going to see callouts as bumps in the road.

We don't have this problem w/ server side source highlighters since Asciidoctor removes the callouts, then puts them back after highlighting.
so what you have to do is emulate that behavior on the client side.
it's dirty work, but someone has to do it ;)
i definitely think that this part of Asciidoctor needs to be extracted into some reusable bits, because it's really not helpful that it's all inlined
Guillaume Grossetie
@Mogztter
Make sense but I've never experienced this issue in the browser extension...
Alright I will try both approaches
bodtx
@bodtx
@Mogztter maybe because I use the
hljs.highlightAuto(myhtmlblock)
I've tested highlightjs with the empty attribute :icons: ans it is working also
@mojavelinux ok put them back myself was my last plan, watching your coe I understand you are making a map for each line where there is a callout at the end, then putting them back after procesing
bodtx
@bodtx
After testing, I'm sur there is a difference between
hljs.initHighlighting()
and
hljs.highlightAuto(myhtmlblock)
bodtx
@bodtx
Ok I've found, my error was to use .contentText instead of .innerHtml to get the text from asciidoctor to pass tohighlightjs.
so with contentText, no img of course.
now indead I have this as @mojavelinux said, I have to replace it after highlightjs process
image.png
Dan Allen
@mojavelinux
There may be a simpler solution!
reveal.js integrates with highlight.js and seemed to figure out how to ignore callouts
perhaps we can do what it does to avoid problems w/ our callout numbers
bodtx
@bodtx
indeed but this is working only for
hljs.initHighlighting() refering to this code:
https://github.com/hakimel/reveal.js/blob/master/plugin/highlight/highlight.js#L14
not hljs.highlightAuto(myhtmlblock)
bodtx
@bodtx

hey looking their code, they were using: hljs.highlightBlock( event.currentTarget );
I was using hljs.highlightAuto(myhtmlblock)

so this other method works with callouts :smile: