by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 11:47
    DanielSWolf opened #3697
  • Jul 02 12:10
    john-cj edited #3696
  • Jul 02 12:09
    john-cj edited #3696
  • Jul 02 12:09
    john-cj edited #3696
  • Jul 02 12:07
    john-cj opened #3696
  • Jul 02 07:45
    mojavelinux labeled #3695
  • Jul 02 01:54
    nyckmaia closed #3695
  • Jul 02 01:41
    nyckmaia edited #3695
  • Jul 02 01:29
    nyckmaia edited #3695
  • Jul 02 01:28
    nyckmaia edited #3695
  • Jul 02 01:28
    nyckmaia opened #3695
  • Jun 29 06:02
    mojavelinux labeled #3694
  • Jun 29 06:02
    mojavelinux milestoned #3694
  • Jun 29 06:02
    mojavelinux assigned #3694
  • Jun 29 06:02
    mojavelinux edited #3694
  • Jun 29 06:01
    mojavelinux edited #3694
  • Jun 29 05:59
    mojavelinux opened #3694
  • Jun 29 05:51
    mojavelinux closed #3690
  • Jun 29 05:51
    mojavelinux closed #3691
  • Jun 25 20:16
    lcawl opened #3693
Dan Allen
@mojavelinux
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
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.
Behrang
@behrangsa
Thanks. I tried using a multi char separator but that didn't seem to work (e.g. @@@)
Dan Allen
@mojavelinux
the separater has to be a single character
but it's better to use a non-ASCII character because eventually you will have whatever character (or sequence) of ASCII you come up with
Matthew Setter
@settermjd
@mojavelinux, no, wondering if they can be used side by side in an anded way.
Behrang
@behrangsa
@mojavelinux + won't work if the regex itself contains +, for example: https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)
Is there a way to use something other than + to demarcate literal passthroughs?
Behrang
@behrangsa

the separater has to be a single character

In the docs it is mentioned that:

Each data format has a default separator associated with it (csv = comma, tsv = tab, dsv = colon), but the separator can be changed to any character (or even a string of characters) by setting the separator attribute on the table.

Dan Allen
@mojavelinux
@settermjd no, they can't be used side-by-side, as in a compound condition. They can only be nested to accomplish that. You can find examples starting here: https://github.com/asciidoctor/asciidoctor/blob/master/test/reader_test.rb#L2136
@behrangsa true. AsciiDoc was primarily design for human shorthand, so you are going to run into edge cases when trying to generate it. you just have to implement the same escaping logic the human would do

@behrangsa is a shorthand for pass:c[] so:

`+text+`

is like:

`pass:c[text]`

this is explained here: https://asciidoctor.org/docs/user-manual/#literal-monospace

@behrangsa docs are wrong
Guillaume Grossetie
@Mogztter
@mojavelinux Any reason why we are not using https://tdg.docbook.org/tdg/4.5/videoobject.html to convert video nodes?
Dan Allen
@mojavelinux
No reason I can think of other than we just never did it.
bob roro
@bobroro_gitlab
Hello all, new here! Has anybody worked with asciidoctor-pdf, I'm trying to take an antora asciidoc page (with tables) and also convert it to pdf and I'm noticing tables in the pdf overflowing text to other rows, thoughts...
bob roro
@bobroro_gitlab
looks like it's my theme that's causing it. not sure where though
bob roro
@bobroro_gitlab
using version 1.5.0, not sure if that makes a difference
Guillaume Grossetie
@Mogztter
No reason I can think of other than we just never did it.
good, I will open an issue and submit a pull request then :smile:
Dan Allen
@mojavelinux
:+1:
@bobroro_gitlab in order to help you, we'd need to see an example
Dan Allen
@mojavelinux
I am VERY close to getting the new keep together logic working in Asciidoctor PDF. then I'm going to switch to adding the block border and shading after the content (instead of before). and finally, we will make keep together opt in.
the new logic tracks the start and end cursor instead of the block height, which means it draws the border and background around the content accurately
and it means we don't have to move a block to the next page if it has to be split anyway
David Jencks
@djencks_gitlab
Hmm, It seems to me that all the looping behavior in paged.js comes from their page break algorithm trying to keep things together. I have a hard time understanding their logic. Where is your algorithm for this?
Dan Allen
@mojavelinux
the algorithm in Asciidoctor PDF is very primitive. it was just woefully broken, which I'm fixing
the algorithm is to try to use a full page. if it fits on the previous page, move it back. if it doesn't fit on a full page, move it back and let it break normally.
but there is no orphan or widow support. this is just about drawing the boxes accurately.
David Jencks
@djencks_gitlab
I found an academic paper on pagination for TeX which seemed to indicate that it's not a very well understood problem.
Dan Allen
@mojavelinux
the problem in Asciidoctor PDF is that it cannot move things around once they are rendered. so you have to keep rendering over and over until you get it where you want it. which is never going to be great, but it can at least not make mistakes
it's an extremely difficult problem to solve, but the browser w/ JavaScript at least gives us the best tools to work on it.
David Jencks
@djencks_gitlab
Maybe you know offhand the answer to this.... paged.js overflow detection off the bottom of the page looks for a block that is too wide, I would naively have expected the height to be too large rather than the width. Do you know why? IIUC it's looking at the boxes chromium comes up with.
Dan Allen
@mojavelinux
i don't have that level of familiarity with paged.js (yet). though what you're expecting seems logical to me.
matrixbot
@matrixbot
@pablo Hey peeps. Is there a guide on how tto procedurally create an asciidoc document using the Asciidoctor ruby API?
@pablo I need to proceduraly append some data to an existing document
Guillaume Grossetie
@Mogztter
You should check out the Asciidoctor Ruby API documentation: https://www.rubydoc.info/github/asciidoctor/asciidoctor/Asciidoctor%2FAbstractBlock:%3C%3C
You can also find some examples on how to create a blocks/nodes from the Asciidoctor extensions lab repository on GitHub
As far as I know there's no official guide but you can find some resources here and there
matrixbot
@matrixbot

@pablo > <@gitter_mogztter:matrix.org> You should check out the Asciidoctor Ruby API documentation: https://www.rubydoc.info/github/asciidoctor/asciidoctor/Asciidoctor%2FAbstractBlock:%3C%3C

Thanks! I was looking for this kind of documentation but I couldn't find it. Really helped me outhere (I was reading the inline docs in the source code before I read your message hehe)

@pablo Also, there were a fell things I coundn't figure out after reading the docs:
  1. How to configure the documents favicon via the Asciidoctor API

@pablo * Also, there were a fell things I coundn't figure out after reading the docs:

  1. How to configure the documents favicon via the Asciidoctor API?

  2. How to remove the numbers that preceed the section titles?

  3. How to make a link bold? My intuition was to create an Inline with context set to :inline_anchor and :type set to :xref and place it inside an empty paragraph Block with :type set to :strong, but that doesn't seem to work.

skanehira
@skanehira
Hi
I'm developping the asciidoc editor with asciidoctor.js
Can I ask some questions in this room?
David Jencks
@djencks_gitlab
Sure!
skanehira
@skanehira
Thank you :)
skanehira
@skanehira

I developing WYSIWYG editor with editor.js and asciidoctor.js
https://editorjs.io

editor.js is block style.
I have no idea how create block from file because file is not structed text.
This is my current problem.

asciidoctor.js Document object has blocks property, so I thought it could be converted to HTML in block units and tried it.

But the section titles, admonitions doesn't converted to HTML.(There may be other syntax that is not converted)

e.g
file contents.

== This is section
- Gorilla
- Cat

[NOTE]
====
- Dog
- Bird
- Cat
====

converted HTML.

<div class="ulist">
<ul>
<li>
<p>Gorilla</p>
</li>
<li>
<p>Cat</p>
</li>
</ul>
</div><div class="ulist">
<ul>
<li>
<p>Dog</p>
</li>
<li>
<p>Bird</p>
</li>
<li>
<p>Cat</p>
</li>
</ul>
</div>

The sample convert code.

const asciidoctor = new Asciidoctor()

function convert(blocks) {
  let output = ""
  for (const block of blocks) {
    if (block.hasBlocks() && block.blocks[0].node_name !== "list_item") {
      output += convert(block.blocks)
    } else {
      output += block.convert()
    }
  }
  return output
}

function output() {
  const input = document.getElementById("input")
  const output = document.getElementById("output")
  const doc = asciidoctor.load(input.value)
  output.innerHTML = convert(doc.blocks)
}

Is there a way to convert syntax such as selections and admonitions?

image.png