Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 16 12:18
    pgundlach assigned #331
  • Apr 16 12:18
    pgundlach labeled #331
  • Apr 16 12:18
    pgundlach opened #331
  • Apr 16 10:50
    pgundlach assigned #330
  • Apr 16 10:50
    pgundlach labeled #330
  • Apr 16 10:50
    pgundlach opened #330
  • Apr 16 08:42
    pgundlach closed #329
  • Apr 16 08:42
    pgundlach closed #327
  • Apr 16 08:42

    pgundlach on develop

    New alignment (PlaceObject) hre… B: <NewPage openon="..."> at en… Regenerate QA for speedup compa… and 2 more (compare)

  • Apr 15 18:01
    pgundlach labeled #329
  • Apr 15 18:01
    pgundlach assigned #329
  • Apr 15 18:01
    pgundlach opened #329
  • Apr 15 11:54
    pgundlach closed #326
  • Apr 15 11:54
    pgundlach commented #326
  • Apr 15 11:53
    pgundlach closed #328
  • Apr 15 11:53

    pgundlach on develop

    Minor cleanup Transparent text, images and co… D: rename MP graphics and 4 more (compare)

  • Apr 15 07:45
    pgundlach labeled #328
  • Apr 15 07:45
    pgundlach assigned #328
  • Apr 15 07:45
    pgundlach opened #328
  • Apr 15 07:45
    pgundlach assigned #327
Joerg
@jorg.l_gitlab

Naja, damit kann ich gerade noch so leben.
Auch eine Locale-Abhängigkeit haben die Datumsfunktionen aus Lua (os.date). Ist daran gedacht, diese (zumindest in der engl. Variante) mit den entsprechenden Formatierungsparametern zu unterstützen?

Noch eine andere Frage: Im Beispiel „runningsum“ ist die Ausgabe einer Summe in der Fußzeile einer Tabelle beschrieben. Die fertigen Summen werden aber alle direkt aus der Datei data.xml geholt. Gibt es eine einfache Möglichkeit, die Summe direkt im zu erstellenden Dokument zu berechnen?

Patrick Gundlach
@pgundlach

@jorg.l_gitlab Ich habe derzeit keine Pläne, os.date etc. zu unterstützten. Eher das, was es bei XPath in dieser Richtung gibt, wobei ich gerade da keinen Überblick habe.

Zu runningsum: klar, kann man die Daten auch dynamisch berechnen. Du musst nur die Variable _last_tr_data zu jeder Zeile neu setzen.

raymondns
@raymondns
Hello, is there an easy way to handle date formatting? For example, the date 2019-09-20 (YYYY-MM-DD) can this be converted to 09/20/2019 (MM/DD/YYYY)?
Patrick Gundlach
@pgundlach
@raymondns actually there is none. I usually do that in an extra step before layout (with xslt). But you could add an issue to the bug tracker.
You could tokenize the string and re-build it.
Mihail-Cosmin Munteanu
@MihailCosmin
Hello, is there any way of knowing the final number of pages the PDF will have from the start of the printing process?
I need to write the page numbers as "Page 1 of 10"
iclukas
@iclukas
No, how could you? There’s a description in the docs using two passes. https://doc.speedata.de/publisher/de/kochbuch/seitexvony/
But! You can use <SavePages> to create virtual pages. You can count them with sd:count-saved-pages and write Page X of Y on the virtual pages before putting them in your final pdf with <InsertPages>.
Mihail-Cosmin Munteanu
@MihailCosmin

Thanks, that works, sorry I missed it.
On another topic, is there any way to deal with situations like the below one?
I've been searching around but can't find any starting point at least.

<para> Please refer to the <link address="page12">Chapter 1</link> for a brief history of the <tool>hammer</tool> and more details about its usage. </para>

As you can see <para> element has also text and XML child elements alternating.
For the <link> I would like to create a link using <A>
For the <tool> I would like to create a marker.
Is there any way to achieve this in speedata?

Patrick Gundlach
@pgundlach
@MihailCosmin There is currently no way that I am aware of to handle this. You need to transform it into something like
<data>
    <para>
        <val>Please refer to the </val>
        <link address="page12">Chapter 1</link>
        <val>for a brief history of the </val>
        <tool>hammer</tool>
        <val>and more details about its usage. </val>
    </para>
</data>
... and build the structure of a href=... and marker yourself
Mihail-Cosmin Munteanu
@MihailCosmin

@pgundlach That sounds quite complex, these were just some examples, but there are many many more situations, this would mean we should create a pre-processing program to adjust the XML to these requirements.

Something else I noticed, regarding the internal links to a PDF page, the attribute "link" of the <A> element can only be text.
It would be better if this attribute would allow X-path expressions. Because at the moment the link destination has to be hardcoded in the layout. In many cases you can generate the link and the destination with variables.

Patrick Gundlach
@pgundlach

@MihailCosmin For the first issue: I usually use a preprocessing stage when I get input from some source that I can't control. The publisher comes with Saxon 9 and you can call it with the lua script.

The second issue is quite easy to solve: include your xpath into curly braces, such as link="{ xpath expression }"

Mihail-Cosmin Munteanu
@MihailCosmin
I already had used the curly braces in other places... didn't realize what was their purpose :)
Thanks
Patrick Gundlach
@pgundlach
Usually test=... and select=... take XPath expressions, everything else not.
Mihail-Cosmin Munteanu
@MihailCosmin
Hello, Is there any way to create change bars on the left or right side of paragraphs?
https://help.adobe.com/en_US/framemaker/2019/using/using-framemaker-2019/frm_reviewandcollaborate_re-change-bars.html
Patrick Gundlach
@pgundlach

@MihailCosmin Good question. Depending on how you output paragraphs / text it could be possible now...

If you output a paragraph one by one with PlaceObject or Output, you can ask for the current frame and line number and draw the rules yourself. If you place multiple objects in one go, you are out of luck in the current version.

Mihail-Cosmin Munteanu
@MihailCosmin
For PlaceObject I managed to do it like this, but <Output> can have only <Text> as child, how can I insert <Rule> inside ?
Am I missing something ?
Patrick Gundlach
@pgundlach
@MihailCosmin No, you are not missing anything, Output has only Text as the child. You would have to save the current position and calculate the change bars yourself (sd:current-row('areaname'))
Mihail-Cosmin Munteanu
@MihailCosmin

This worked well for text paragraphs, but for table rows it won't work, right? For each row I get the row the whole table was output.
I think this is what you meant with "If you place multiple objects in one go, you are out of luck in the current version."

Will there be a solution in the next version?

Patrick Gundlach
@pgundlach
@MihailCosmin for table rows this will not do, right. You can only get the boundaries for the whole table.
I don't know how a solution(interface) would look like.
Mihail-Cosmin Munteanu
@MihailCosmin

Found a workaround for the moment. Works quite well.
For each table row I add first an extra <td> with no borders that has and empty paragraph.
I check if the row (from the data) should have a change bar, then output the extra <td> with a border on the left side.

The change bar is a bit more inside the page than the text ones, but it's satisfactory for now.

Mihail-Cosmin Munteanu
@MihailCosmin
Hello,
I think there is an issue with the hyphenate attribute of the DefineTextFormat.
I have it set to hyphenate ="no", yet wherever I have text like "20-12-2019" it can happen that I have 20- on one line and the rest -12-2019 on the next line.
I have also tried to set hyphenate ="yes" and hyphenchar ="ß" yet it keeps splitting anywhere I have dashes.
Is there anyway I can set it up so it won't split where I have dashes in different rows?
Patrick Gundlach
@pgundlach
Have you tried <Nobreak>?
Emmanuel Oga
@EmmanuelOga
hi! discovered speedata publisher today, just a quick q about impl, I was wondering how does the XML processing happen? I was browsing the source expecting to find some XSLT transformations, but it seems the XML is read and processed either from go or lua, I can't tell yet. I also saw the saxon and calabash jars, etc.. so I'm not sure what's the pipeline actually :-p
Patrick Gundlach
@pgundlach

@EmmanuelOga The data XML is processed while executing the layout.xml file. You could preprocess the data file if you want (that is why saxon is part of the distribution)

The logic in the layout file is a mixture of XSLT and HTML, so not directly comparable. I assume you have found the hello world example in the manual? https://doc.speedata.de/publisher/en/helloworld/#ch-helloworld

@EmmanuelOga and perhaps the section on programming? (https://doc.speedata.de/publisher/en/programming/#ch-programming)
Emmanuel Oga
@EmmanuelOga
tbh I did not realize speedata implemented a whole new language in xml
i was wondering how it works internally, do you translate the layout file to xslt and then execute that?
Patrick Gundlach
@pgundlach
No, I wrote an interpreter for that langauge (a very simple one, though). The commands are executed right away when reading them.
Emmanuel Oga
@EmmanuelOga
this XML application is unlike anything I've seen before :-)
Patrick Gundlach
@pgundlach
I admit it is a bit special...
Emmanuel Oga
@EmmanuelOga
oh cool! is that because you deemed xslt unfit for some reason? where can I check the interpreter/
?
Patrick Gundlach
@pgundlach
XSLT has no layout capabilities it just transforms a into b, often used with XSL-FO, which is too static and cannot do fancy optimization things.
With interpreter, you mean the source of it?
Emmanuel Oga
@EmmanuelOga
well you said there's an interpreter for the xml-based language
But the user never sees all this.
Emmanuel Oga
@EmmanuelOga
right
I saw there's quite a bunch of go too
Patrick Gundlach
@pgundlach
Yes, used in two places: a) for a start program that collects everything needed and to run the LuaTeX process and b) as a dynamic library during the publishing run to access HTTP resources and parse HTML and CSS
Emmanuel Oga
@EmmanuelOga
gotcha
so the publisher lua code runs directly in luatex?
Patrick Gundlach
@pgundlach
yes
Emmanuel Oga
@EmmanuelOga
so my use case is I have this small markup language, a bunch of XML files with a super minimal RNG schema,
I can convert it to wathever. I was thinking to use xsl-fo to create a book of some content
but speedata seems a lot nicer for things with pictures and looking more like a nice book than a technical manual
I'm guessing that I'll use an XSLT script to convert my XML files to speedata XML dialect