by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 06:39
    tnir opened #3769
  • 06:37
    tnir opened #3768
  • Sep 28 13:25
    wesruv edited #3767
  • Sep 28 13:24
    wesruv edited #3767
  • Sep 28 13:23
    wesruv opened #3767
  • Sep 28 06:00
    mojavelinux synchronize #3766
  • Sep 28 05:49
    mojavelinux opened #3766
  • Sep 27 06:28
    mojavelinux labeled #3765
  • Sep 27 06:28
    mojavelinux unlabeled #3765
  • Sep 27 06:27
    mojavelinux labeled #3765
  • Sep 27 06:27
    mojavelinux unlabeled #3765
  • Sep 27 06:27
    mojavelinux milestoned #3765
  • Sep 27 06:27
    mojavelinux demilestoned #3765
  • Sep 27 06:00
    mojavelinux edited #3765
  • Sep 27 05:59
    mojavelinux milestoned #3765
  • Sep 27 05:59
    mojavelinux labeled #3765
  • Sep 27 05:59
    mojavelinux assigned #3765
  • Sep 27 05:59
    mojavelinux opened #3765
  • Sep 27 05:53
    mojavelinux labeled #3764
  • Sep 27 05:53
    mojavelinux milestoned #3764
Jason Porter
@LightGuard
I have a band-aid in place.
David Jencks
@djencks_gitlab
I'm impressed you found a band-aid :-)
Jason Porter
@LightGuard
Had to drop down to the private API to access the underlying ruby objects
David Jencks
@djencks_gitlab
At least it's possible :-)
Dan Allen
@mojavelinux
yep. we do want to expose the raw text, but as you can see from the conversation, we got stuck on terminology
I often need the raw text when writing migration scripts, and so far I have just tapped the private instance variable (which really isn't private in Ruby)
as I've said before, we didn't start with mapping the entire API (which is what we'll do in the spec), so in Asciidoctor it's kind of map as we need stuff
David Jencks
@djencks_gitlab
makes sense :-)
Dan Allen
@mojavelinux
semver should help us iterate faster on this stuff

@settermjd wrote:
Can multiple ifeval directives be used together?

you mean can they be nested?

as a side note about this channel, what is the source of the matrixbox messages? they seem to be really hard to follow and respond to. is there anyway that proxy can be reconfigured to post as an actual account?
Ɓukasz Jan Niemier
@hauleth
Is there formal specification of the ASCIIDoc syntax? I wanted to write implementation in different language (Erlang/Elixir to be exact) and such document would help me a lot.
Behrang
@behrangsa

I am generating an AsciiDoc document using a Mustache template.

Somewhere in my template, I have a block like this:

----
{{#firstName}}First Name: {{firstName}}{{/firstName}}
{{#middleName}}Middle Name: {{middleName}}{{/middleName}}
{{#lastName}}Last Name: {{lastName}}{{/lastName}}
----

If middleName is empty, Mustache will generate something like this:

----
First Name: Arnold

Last Name: Schwarzenegger
----

Does AsciiDoctor provide an option to avoid outputting the empty blank line to the output?

David Jencks
@djencks_gitlab
@behrangsa not as far as I know, but your template clearly says to put the blank line in, so you presumably want it. If you don't, change your template to be something like:
----
{{#firstName}}First Name: {{firstName}}{{/firstName}}
{{#middleName}}Middle Name: {{middleName}}
{{/middleName}}{{#lastName}}Last Name: {{lastName}}{{/lastName}}
----
Marat Radchenko
@slonopotamus
@gregturn it isn't currently possibly to use custom fonts in asciidoctor-epub3, but we have a feature request for that: asciidoctor/asciidoctor-epub3#62
Dan Allen
@mojavelinux
@behrangsa that's a handlebars thing. you need to use an {{#if}} conditional. handlebars will then remove that line if it's false.
@slonopotamus :+1:
David Jencks
@djencks_gitlab
isn't {{#middleName}} equivalent to an {{#if}} expression? My experience is that you need to include the newline in the conditional include, or you get it whether or not the condition is true.
Dan Allen
@mojavelinux
i was not aware of that syntax
what I do know is that if you use {{#if}} on a line, and it is false, handlebars will remove that line
actually, correction
that content inside needs to be on its own line, so I guess it's the either way
{{#if middlename}}
{{middlename}}
{{/if}}
regardless, this is a handlebars thing
David Jencks
@djencks_gitlab
that's for sure :-)
Ewan Edwards
@eskwayrd
David Jencks
@djencks_gitlab
That's the legible answer!!
Behrang
@behrangsa
@mojavelinux Unfortunately for the time being, I am forced to use the Mustache engine which doesn't have {{#if}} and similar constructs...
David Jencks
@djencks_gitlab
I think the #middleName has the same effect. If mustache doesn't have that nice feature Ewan found I think you can just put the newline inside the conditional as I suggested.
Not knowing about ~ I've done that with handlebars :-)
Behrang
@behrangsa
@djencks_gitlab That should do the trick. Thanks!
David Jencks
@djencks_gitlab
even though I've never had a handlebar mustache I certainly find it easy to confuse handlebars and mustache!! I completely thought you were talking about handlebars :-)
Dan Allen
@mojavelinux
@behrangsa @djencks_gitlab :+1:
@djencks_gitlab same confusion here
Behrang
@behrangsa

Escaping Problem

I have a JSON document that looks like this

{
  "name" : "Price",
  "type" : "Currency",
  "pattern" : "/^((0)|([1-9]([0-9]){0,9}))((\\\\.(\\\\d\\\\d)))?$/"
}

Using a Mustache template, this is converted into this AsciiDoc document

= Test

== Table

[separator="@"]
|===
@ Name
@ Type
@ Pattern

@ Price
@ Currency
a@ `/^((0)|([1-9]([0-9]){0,9}))((\\.(\\d\\d)))?$/`
|===

The regex is legacy and not well written, but it is valid. However, when rendered, the generated HTML for the regex pattern doesn't look right:

<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>/^0)|([1-9]([0-9]){0,9}\\.(\\d\\d)?$/</code></p>
</div></div></td>
</tr>

Looks like all (( and )) occurrences are stripped out. Any ideas how can I render the regex in the output correctly?

David Jencks
@djencks_gitlab
Would inline passthrough help? +++complicated+++
perhaps
+++<code>/^((0)|([1-9]([0-9]){0,9}))((\\.(\\d\\d)))?$/</code>+++
David Jencks
@djencks_gitlab
or maybe
`+++/^((0)|([1-9]([0-9]){0,9}))((\\.(\\d\\d)))?$/+++`
Behrang
@behrangsa
Let me check...
I wonder what would happen if I have < in my regex though...
That seems to work. In order to properly escape <, though, I should use the single plus passthrough. Thanks!
Dan Allen
@mojavelinux
what you are looking for is a literal passthrough
which is the second thing @djencks_gitlab suggested, but you only need a single set of +
`+CONTENT HERE+`
that's closest to Markdown's backticks
you don't need an AsciiDoc table cell for inline formatting
that's only necessary if you are using block elements like a listing block
Dan Allen
@mojavelinux
in other words:
@ `+/^((0)|([1-9]([0-9]){0,9}))((\\.(\\d\\d)))?$/+`
if this is generated code, I would recommend using a less common table cell separator, like the broken vertical bar.