GithubHelp home page GithubHelp logo

jelovirt / pdf-generator Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 5.0 1.9 MB

DITA-OT PDF plug-in generator

Home Page: https://dita-generator.elovirta.com/

License: Apache License 2.0

JavaScript 2.66% HTML 0.40% SCSS 2.22% TypeScript 53.05% Shell 0.13% XSLT 37.48% Java 4.06%
dita dita-ot-plugin dita-ot nodejs code-generator hacktoberfest

pdf-generator's Introduction

DITA-OT PDF plug-in generator Node.js CI Netlify Status

DITA-OT PDF plug-in generator is a TypeScript program that generates DITA-OT plug-ins that extend the default PDF2 plug-in.

Development

  1. Install dependencies
    > nvm use
    > npm install
  2. Start development server
    > npm start
    Generator UI is available at http://localhost:1234.

Testing

  1. Run unit-tests
    > npm test

Distribution

  1. Install dependencies
    > nvm use
    > npm install
  2. Run distribution build
    > npm run build
    Distribution files are available in dist directory.

Donating

Support this project and others by @jelovirt via GitHub Sponsors.

License

DITA-OT PDF plug-in generator is licensed for use under the Apache License 2.0.

pdf-generator's People

Contributors

dependabot[bot] avatar figure002 avatar infotexture avatar jelovirt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pdf-generator's Issues

Multilanguage support for `content`

Allow content keys to define multiple languages, e.g.

header:
  content:
    en-US: User Manual
    de-DE: Benutzerhandbuch

If language code is not set, the language defaults to empty string, i.e. no language. Thus it will be used for all languages.

header:
  content: "{title}"

is desugared to

header:
  content:
    "": "{title}"

Rename odd/even to recto/verso

Should odd and even page configuration keys be renamed to recto (right-hand, odd-numbered pages) and verso (left-hand, even-numbered pages), respectively? The new terms would be less common, but they would be more accurate.

For example Asciidoctor PDF uses recto and verso

Support for dita-ot 3.4

Would that be some time soon possible to add support for dita-ot 3.4? Apparently, there are some architectural changes in the most recent versions, causing inconsistency for the created plug-ins.

`style/body/line-height` is not respected

Steps to reproduce

  1. Create a PDF output using a theme file included with DITA-OT (e.g. dita-ot/docsrc/samples/themes/dita-ot-docs-theme.yaml)
  2. In the theme file change:
style:
  body:
    line-height: 1.3

to:

style:
  body:
    line-height: 2.3
  1. Create a PDF output using the updated theme file.

Result

The line height has not changed in block content (paragraphs, etc.).

Expected result

The line height should change accordingly.

Notes

I noticed that it does work for

style:
  cover-title:
    line-height: 1

But it also doesn't work for

style:
  h1:
    line-height: 1

PDF `--theme`: Table header styling

Another common customization is to define shaded backgrounds for table header cells defined in <thead> elements.

Would be nice if this could be specified in the theme file with a syntax like this:

style:
  table:
    header:
      background-color: $brand-color-inverse
      color: $brand-color-secondary

This would be useful along with overrides for common.border properties per #54 (comment).

topic2fo_shell_fop.xsl contains invalid link

When generating a 3.0 plugin for FOP, the topic2fo_shell_fop.xsl contains a link to a file, that does not exist anymore, at least in DITA-OT 3.2:

<xsl:import href="plugin:org.dita.pdf2.fop:cfg/fo/attrs/toc-attr_fop.xsl"/>

PDF `--theme`: Character replacement

When building PDF output with --theme, different fonts appear to be used when compared to default PDF2 output
— even if the theme file does not override any font-family settings.

When building the DITA-OT docs PDF, certain characters are replaced with #, for example:

  • In the Supported languages topic, all language names in the table are represented correctly when building with PDF2
    — such as 日本語 (Japanese) — but output generated with --theme shows ### (Japanese).

  • In codeblocks such as those in PDF plug-in structure, directory listing characters such as are replaced with #.

    • PDF2 output
      .
      ├── build.properties.orig
      ├── catalog.xml.orig
      └── fo/
          ├── attrs/
          │   └── custom.xsl.orig
          └── xsl/
              └── custom.xsl.orig
      
    • --theme output
      .
      ### build.properties.orig
      ### catalog.xml.orig
      ### fo/
          ### attrs/
          #   ### custom.xsl.orig
          ### xsl/
              ### custom.xsl.orig
      

Empty, invalid "text-align" attributes are generated

When you generate a plugin, many empty "text-align" attributes are generated in the form of <xsl:attribute name="text-align" />. The problem is that Apache FOP throws errors on these invalid tags like the following:

[fop] [ERROR] Invalid property value encountered in text-align="": org.apache.fop.fo.expr.PropertyException: file:/tmp/temp20191111211848401/topic.fo:549:1207: No conversion defined ; property:'text-align' (See position 554:374)
[fop] org.apache.fop.fo.expr.PropertyException: file:/tmp/temp20191111211848401/topic.fo:549:1207: No conversion defined ; property:'text-align'
[fop]     at org.apache.fop.fo.properties.PropertyMaker.make(PropertyMaker.java:446)
[fop]     at org.apache.fop.fo.PropertyList.convertAttributeToProperty(PropertyList.java:499)
[fop]     at org.apache.fop.fo.PropertyList.addAttributesToList(PropertyList.java:386)
[fop]     at org.apache.fop.fo.FObj.processNode(FObj.java:127)
[fop]     at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:293)
[fop]     at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:179)
[fop]     at net.sf.saxon.event.ContentHandlerProxy.startContent(ContentHandlerProxy.java:385)
[fop]     at net.sf.saxon.event.ProxyReceiver.startContent(ProxyReceiver.java:177)
[fop]     at net.sf.saxon.event.SequenceNormalizer.startContent(SequenceNormalizer.java:163)
[fop]     at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:446)
[fop]     at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
[fop]     at org.ditang.relaxng.defaults.RelaxNGDefaultsComponent.startElement(RelaxNGDefaultsComponent.java:210)
[fop]     at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
[fop]     at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
[fop]     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
[fop]     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
[fop]     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[fop]     at org.ditang.relaxng.defaults.RelaxDefaultsParserConfiguration.parse(RelaxDefaultsParserConfiguration.java:111)
[fop]     at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[fop]     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
[fop]     at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
[fop]     at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
[fop]     at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:434)
[fop]     at net.sf.saxon.event.Sender.send(Sender.java:141)
[fop]     at net.sf.saxon.jaxp.IdentityTransformer.transform(IdentityTransformer.java:366)
[fop]     at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:293)
[fop]     at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:116)
[fop]     at org.apache.fop.tools.anttasks.FOPTaskStarter.renderInputHandler(Fop.java:648)
[fop]     at org.apache.fop.tools.anttasks.FOPTaskStarter.render(Fop.java:671)
[fop]     at org.apache.fop.tools.anttasks.FOPTaskStarter.run(Fop.java:532)
[fop]     at org.apache.fop.tools.anttasks.Fop.execute(Fop.java:369)
[fop]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[fop]     at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
[fop]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[fop]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[fop]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
[fop]     at org.apache.tools.ant.Task.perform(Task.java:350)
[fop]     at org.apache.tools.ant.Target.execute(Target.java:449)
[fop]     at org.apache.tools.ant.Target.performTasks(Target.java:470)
[fop]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1391)
[fop]     at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
[fop]     at org.apache.tools.ant.Project.executeTargets(Project.java:1254)
[fop]     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
[fop]     at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:106)
[fop]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[fop]     at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
[fop]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[fop]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[fop]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
[fop]     at org.apache.tools.ant.Task.perform(Task.java:350)
[fop]     at org.apache.tools.ant.Target.execute(Target.java:449)
[fop]     at org.apache.tools.ant.Target.performTasks(Target.java:470)
[fop]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1391)
[fop]     at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
[fop]     at org.apache.tools.ant.Project.executeTargets(Project.java:1254)
[fop]     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
[fop]     at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:106)
[fop]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[fop]     at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
[fop]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[fop]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[fop]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
[fop]     at org.apache.tools.ant.Task.perform(Task.java:350)
[fop]     at org.apache.tools.ant.Target.execute(Target.java:449)
[fop]     at org.apache.tools.ant.Target.performTasks(Target.java:470)
[fop]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1391)
[fop]     at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
[fop]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[fop]     at org.apache.tools.ant.Project.executeTargets(Project.java:1254)
[fop]     at org.dita.dost.invoker.Main.runBuild(Main.java:637)
[fop]     at org.dita.dost.invoker.Main.startAnt(Main.java:195)
[fop]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
[fop]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

PDF `--theme`: `table-continued` not respected

The table continuation settings don't seem to be applied.

Tried setting as nested table style key per pdf-generator/wiki/Styles#table:

style:
  table:
    table-continued: true

and also as root key:

table-continued: true

but neither had any effect.

Converted the DITA-OT error messages table in §10.3 from simple table to CALS to verify, but no continuation text appears.

page header present despite selecting "empty"

I want a blank header and a blank footer. So I select "empty" for the header and do not select "drop folio".

Unfortunately, the page header still contains both the chapter title and the page number. (The page footer is blank).

I have attached the generated plugin.

pdfmr1.zip

Ticking title numbering

Ticking title numbering in the interface is OK for numbering titles but the generated TOC titles are not numbered.

Thanks, cheers

Template format

Design JSON format for template/theme files. The same format can be used in YAML.

The current format is used internally by the UI code and has not been designed with hand authoring in mind.

Example with parts missing

{
  "page": {
    "height": "297mm",
    "width": "210mm",
    "top": "20mm",
    "outside": "20mm",
    "bottom": "20mm",
    "inside": "20mm"
  },
  "header": {
    "odd": ["title"], 
    "even": ["chapter"]
  },
  "footer": {
    "odd": ["folio"],
    "even": ["folio-with-total"]
  },
  "style": {
    "header": {
      "background-color": "orange",
      "font-weight": "bold",
      "start-indent": "20mm",
      "end-indent": "20mm",
      "space-before": "10mm"
    },
    "footer": {
      "background-color": "yellow",
      "text-align": "center",
      "start-indent": "20mm",
      "end-indent": "20mm",
      "space-after": "10mm"
    },
    "body": {
      // style definition can use basically any FO property
      "background-color": "transparent",
      "padding-top": "0pt",
      "padding-right": "0pt",
      "padding-bottom": "0pt",
      "padding-left": "0pt",
      "end-indent": "0pt",
      "border-before-style": "none",
      "border-before-width": "1pt",
      "border-before-color": "black",
      "border-end-style": "none",
      "border-end-width": "1pt",
      "border-end-color": "black",
      "border-after-style": "none",
      "border-after-width": "1pt",
      "border-after-color": "black",
      "border-start-style": "none",
      "border-start-width": "1pt",
      "border-start-color": "black",
      "font-family": "Times New Roman",
      "font-size": "10pt",
      "color": "black",
      "font-weight": "normal",
      "font-style": "normal",
      "text-decoration": "none",
      "space-before": "6pt",
      "space-after": "6pt",
      "text-align": "start",
      "start-indent": "25pt",
      "line-height": "1.2"
    },
    // actually topic tittle
    "topic": {
      "background-color": "pink",
      "padding-top": "0pt",
      …
      // This property is not FO, it's part of our property set
      "title-numbering": true
    },
    "ol": {
      …
      "ol-1": "1",
      "ol-2": "1",
      "ol-3": "1",
      "ol-4": "1",
      "ol-after-1": ". ",
      "ol-after-2": ". ",
      "ol-after-3": ". ",
      "ol-after-4": ". "
    },
    "link": {
      "font-family": "Times New Roman",
      "font-size": "10pt",
      "color": "blue",
      "background-color": "transparent",
      "font-weight": "normal",
      "font-style": "normal",
      "text-decoration": "none",
      "line-height": "1.2",
      "link-page-number": true
    }
  },
  // some of these are global options, but some are part of some other section. Like mirror_page_margins is part of page key, but is here for said reasons
  "mirror_page_margins": true,
  "blank_pages": true,
  "body_column_count": 1,
  "index_column_count": 2,
  "column_gap": "12pt",
  "force_page_count": "even",
  "chapter_layout": "BASIC",
  "cover_image_metadata": "cover-image",
  "bookmark_style": "COLLAPSED",
  "toc_maximum_level": 4,
  "task_label": true,
  "include_related_links": "none",
  "table_continued": true,
  "page_number": "chapter-page"
}

Refactored format with changes inline, ie. edit this code block and add comments:

{
  "page": {
    "height": "297mm",
    "width": "210mm",
    "top": "20mm",
    "outside": "20mm",
    "bottom": "20mm",
    "inside": "20mm"
  },
  "header": {
    "odd": {
      "content": ["title"]
    }, 
    "even": {
      "content": ["chapter"]
    }
  },
  "footer": {
    "odd": {
      "content": ["folio"],
    }
    "even": {
      "content": ["folio-with-total"]
    }
  },
  "style": {
    "header": {
      "background-color": "orange",
      "font-weight": "bold",
      "start-indent": "20mm",
      "end-indent": "20mm",
      "space-before": "10mm"
    },
    "footer": {
      "background-color": "yellow",
      "text-align": "center",
      "start-indent": "20mm",
      "end-indent": "20mm",
      "space-after": "10mm"
    },
    "body": {
      "background-color": "transparent",
      "padding-top": "0pt",
      "padding-right": "0pt",
      "padding-bottom": "0pt",
      "padding-left": "0pt",
      "end-indent": "0pt",
      "border-before-style": "none",
      "border-before-width": "1pt",
      "border-before-color": "black",
      "border-end-style": "none",
      "border-end-width": "1pt",
      "border-end-color": "black",
      "border-after-style": "none",
      "border-after-width": "1pt",
      "border-after-color": "black",
      "border-start-style": "none",
      "border-start-width": "1pt",
      "border-start-color": "black",
      "font-family": "Times New Roman",
      "font-size": "10pt",
      "color": "black",
      "font-weight": "normal",
      "font-style": "normal",
      "text-decoration": "none",
      "space-before": "6pt",
      "space-after": "6pt",
      "text-align": "start",
      "start-indent": "25pt",
      "line-height": "1.2"
    },
    // actually topic tittle
    "topic": {
      "background-color": "pink",
      "padding-top": "0pt",
      
      "title-numbering": true
    },
    "ol": {
      
      "ol-1": "1",
      "ol-2": "1",
      "ol-3": "1",
      "ol-4": "1",
      "ol-after-1": ". ",
      "ol-after-2": ". ",
      "ol-after-3": ". ",
      "ol-after-4": ". "
    },
    "link": {
      "font-family": "Times New Roman",
      "font-size": "10pt",
      "color": "blue",
      "background-color": "transparent",
      "font-weight": "normal",
      "font-style": "normal",
      "text-decoration": "none",
      "line-height": "1.2",
      "link-page-number": true
    }
  },
  "mirror_page_margins": true,
  "blank_pages": true,
  "body_column_count": 1,
  "index_column_count": 2,
  "column_gap": "12pt",
  "force_page_count": "even",
  "chapter_layout": "BASIC",
  "cover_image_metadata": "cover-image",
  "bookmark_style": "COLLAPSED",
  "toc_maximum_level": 4,
  "task_label": true,
  "include_related_links": "none",
  "table_continued": true,
  "page_number": "chapter-page"
}

Build error: Failed to generate stylesheet hi-domain.xsl

When building DITA-OT docs PDF output with dita-ot/dita-ot@547228c & 5072768, builds fail with the following error:

Execution failed for task ':pdf'.
> The following error occurred while executing this line:
  /path/to/dita-ot/src/main/plugins/org.dita.base/build.xml:28: 
  The following error occurred while executing this line:
  /path/to/dita-ot/src/main/plugins/com.elovirta.pdf/build.xml:13: 
  Failed to generate stylesheet hi-domain.xsl

Heading 1 bottom of page

Hello, the plug-in looks briliant!

Please notice that when a Heading 1 is at the end of the page the header identifies H1 as header whereas most of the page deals with previous chapter.

It would be more efficient to force H1 to start on top of a new page doesn't it?

Thanks for the job, best regards.

PDF `--theme`: Caption styling

Currently, figure and table styling options allow to set caption-number & caption-position, but there's no apparent way to set font family/style/weight, alignment, etc. for figure/table titles.

If these settings are made on the fig key itself, they apply to the entire figure element:

style:
  fig:
    color: $brand-color-secondary
    font-style: italic
    font-weight: normal
    text-align: center

If the figure contains a code block, the code block text will be centered & italicized too.

PDF `--theme`: Border overrides not applied

When building PDF output with --theme, border overrides are not applied.

For example, if a theme file contains the following entries:

style:
  h1:
    border-after: solid 1pt gray

The first-level headings still use the default thick black bottom borders from the default PDF2 settings.

PDF `--theme`: `keep-together` not respected

Keep together settings are not currently applied.

For example, setting keep-together.within-page: always on code blocks or notes has no effect:

style:
  codeblock:
    keep-together.within-page: always
  note:
    keep-together.within-page: always

Double numbering of chapters in TOC

When I build a PDF using the generated plugin, TOC has entries like:

Chapter 5: 5 This is the fifth chapter

This does not happen with the pdf2 plugin.

PDF builds fail looking for `toc-attr_fop.xsl`

When building DITA-OT docs PDF output with dita-ot/dita-ot@547228c & 5072768, builds fail with the following error:

Execution failed for task ':pdf'.
> The following error occurred while executing this line:
  /path/to/dita-ot/src/main/plugins/org.dita.base/build.xml:28: 
  The following error occurred while executing this line:
  /path/to/dita-ot/src/main/plugins/org.dita.pdf2/build.xml:148: 
  The following error occurred while executing this line:
  /path/to/dita-ot/src/main/plugins/org.dita.pdf2/build.xml:280: 
  java.lang.RuntimeException: Failed to compile stylesheet 
  'file:/var/folders/69/rpqvkjhs497c8kny2ksfjh4c0000gn/T/dita-ot/
  1683391177534/com.elovirta.pdf-1712600268/xsl/fo/topic2fo_shell.xsl': 
  I/O error reported by XML parser processing file:
  /path/to/dita-ot/src/main/plugins/org.dita.pdf2.fop/cfg/fo/attrs/toc-attr_fop.xsl:
  /path/to/dita-ot/src/main/plugins/org.dita.pdf2.fop/cfg/fo/attrs/toc-attr_fop.xsl 
  (No such file or directory)

See following lines for references:

PDF `--theme`: Bookmarks should honor navtitles

When building PDF output with --theme, the bookmarks in the ToC navigation sidebar of the generated PDF file show the full topic titles instead of the navtitles (like default PDF2 output).

PDF `--theme`: Borders on empty headers/footers

When borders are applied to running headers/footers:

header:
  border-after: solid 1pt $brand-color-inverse
footer:
  border-before: solid 1pt $brand-color-inverse

The borders are drawn on every page, even those that do not contain header/footer content — like the title page, empty pages, index, etc.

Since the content is empty, the region height is different from the populated headers/footers, so the border lines appear in different places than they do on pages with real headers/footers.

Not sure how easy this is to change, but would be elegant if borders were only drawn on pages that actually contain header/footer content.

🐛 Plugin version 0.6.0 adds extra space to links

⚠️ The changes from #84 and/or #86 have the unintended side effect of adding spurious leading and trailing space around all links that appear in text.

The effect is particularly apparent when links appear with trailing punctuation such as commas, or at the ends of sentences, as in the Installing DITA Open Toolkit topic of the DITA-OT docs.

• You can download the Oracle JRE or JDK from··oracle.com/java··under commercial license.
• Eclipse Temurin is the free OpenJDK distribution available from··adoptium.net·.

extra-spaces-around-links-theme-plugin-v0 6

Would be good to resolve this regression before merging dita-ot/dita-ot#4044 (see also dita-ot/registry#118).

PDF `--theme`: Chapter-based caption numbering

When using chapter-based numbering for figures & tables per #62, the chapter numbers in captions do not agree with the section numbering in topic titles.

For example, with the following style settings,

style:
  h2:
    title-numbering: true
  table:
    caption:
      number: chapter

the Adding plug-ins via the registry topic from the DITA-OT docs is numbered as §8.3, but the table titles are numbered with 30:

  • Table 30–1: Plug-in version entry structure
  • Table 30–2: Structure for dependency entries

sub-topics are not numbered

When having topics at the end of a topic file (within the topic file, not within the map file), their headings are not numbered, although I checked "title numbering" on all Heading n formats. But sub-topic are influenced by the Heading n formats, e.g. Italics and fonts for sub-topics works, only numbering does not work.

PS: in our application, we generate DITA files dynamically, and it would be difficult to generate seperate files for each topic in these cases.

`style/table/border-*` is not respected

I have a table as such:

<table>
<tgroup cols="2">
<colspec colname="COLSPEC0" colwidth="121*"/>
<colspec colname="COLSPEC1" colwidth="76*"/>
<thead>
<row>
<entry colname="COLSPEC0" valign="top">Animal</entry>
<entry colname="COLSPEC1" valign="top">Gestation</entry>
</row>
</thead>
<tbody>
<row>
<entry>Elephant (African and Asian)</entry>
<entry>19-22 months</entry>
</row>
<row>
<entry>Giraffe</entry>
<entry>15 months</entry>
</row>
<row>
<entry>Rhinoceros</entry>
<entry>14-16 months</entry>
</row>
<row>
<entry>Hippopotamus</entry>
<entry>7 1/2 months</entry>
</row>
</tbody>
</tgroup>
</table>

And I try to style the table with:

style:
  table:
    border-before-style: none
    border-before-width: 1pt
    border-before-color: black
    border-end-style: none
    border-end-width: 1pt
    border-end-color: black
    border-after-style: none
    border-after-width: 1pt
    border-after-color: black
    border-start-style: none
    border-start-width: 1pt
    border-start-color: black

But none of these rules seem to have any effect. I can change the values, but the resulting table remains the same; only a black outer border is displayed.

PDF `--theme`: Support Part/Chapter styling in bookmaps

Currently, when publishing PDF with the --theme option, bookmap Part and Chapter references are styled with h1 like first-level topic titles.

Many authors who publish PDF choose bookmap for the Part and Chapter constructs, so a PDF theme should at least provide basic styling support for these elements.

If labels, numbers, and titles are rendered on separate lines (like in PDF2), it would be convenient to them independently:

style:
  part:
    label:
      color: $brand-color-secondary
      font-size: 18pt
    number:
      color: $brand-color-primary
      font-size: 36pt
    title:
      border-after: solid 2pt $brand-color-inverse
      color: $brand-color-primary
      font-size: 18pt

If this plug-in renders all 3 on one line instead, the title content could be defined with a dedicated key like in #68, and styled separately from first-level topic titles:

style:
  chapter:
    title:
      color: $brand-color-primary
      content: "Chapter {number}: {title}"
      font-size: 18pt

Styles based on outputclass

Is it possible to apply styles to for example notes with a specific outputclass?

Just playing around with the PDF theme functionality, and I have to say it's fantastic and it gets really far in providing all needed styling options without having to dive into XML. When publishing to HTML it's really easy to find people who know enough CSS to be able to style DITA output nicely, and I was looking at the PDF theme functionality to determine whether it would provide a 'similarly simple' type of control.

Looking at the xsl files I think the answer is no, but sadly my xsl knowledge is fairly limited atm. If the answer is no, would this be something that might be considered in the future?

Entires wrongly repeated 3 times in simpletable

In my sample, for a DITA

<simpletable relcolwidth="1* 5*" expanse="column" frame="none" keycol="1">
  <strow>
    <stentry>Name</stentry>
    <stentry>LongValue</stentry>
  </strow>
</simpletable>

the layout using the simply generated plugin is always something like

Name       LongValue LongValue LongValue
Name
Name

Why are the entries repeated 3 times?

Template code appears in UI for list styles

On page 4, where you configure the various styles, the following shows up in the UI under ​Ordered list styles & Unordered list styles:

{% for i in "1234" %} {% endfor %}

Looks like that's code for the ​_Level_​ option.

Allow custom font families

It appears that the user cannot specific custom fonts for the various logical fonts that appear in font-mappings.xml

It would be nice to provide the ability to inject custom font families into this. The user could add one or more comma-separated font families for Sans, Sans-serif, and Monospaced, and these would be added to the beginning of the font-mappings for each.

As an aside, I tried putting in a font-mappings.xml myself and adding it to the catalog.xml, but it doesn't seem to get picked up. The catalog.xml that was generated for me was empty so I added this (with company replaced with the actual name):

<uri name="cfg:fo/font-mappings.xml" uri="fo/font-mappings.xml"/>

Is there something additional that needs to be done to get catalog.xml to get picked up?

EDIT: Removing this line from the integrator.xml that was generated fixed the problem so the font-mappings.xml (or the catalog--not sure what the issue was here) gets picked up.

<property name="pdf2.i18n.skip" value="true" />

Desugaring broken for `header/border-after`

Desugaring seems to be broken for:

header:
  border-after: dotted 1pt black

This works however:

header:
  odd:
    border-after: dotted 1pt black
  even:
    border-after: dotted 1pt black

Generation broken: toc-attr_fop.xsl (The system cannot find the file specified) - DITA-OTs v3.4.1, v3.5.4 and v3.6.1

transform.topic2fo.main: [pipeline] Loading stylesheet C:\DOTK\dita-ot-3.6.1\plugins\com.me.test\xsl\fo\topic2fo_shell_fop.xsl [pipeline] Error on line 1 column 2976 of topic2fo_shell_fop.xsl: [pipeline] XTSE0165: I/O error reported by XML parser processing [pipeline] file:C:/DOTK/dita-ot-3.6.1/plugins/org.dita.pdf2.fop/cfg/fo/attrs/toc-attr_fop.xsl: [pipeline] C:\DOTK\dita-ot-3.6.1\plugins\org.dita.pdf2.fop\cfg\fo\attrs\toc-attr_fop.xsl (The system [pipeline] cannot find the file specified) Error: The following error occurred while executing this line: C:\DOTK\dita-ot-3.6.1\plugins\org.dita.pdf2\build.xml:280: java.lang.RuntimeException: Failed to compile stylesheet 'C:\DOTK\dita-ot-3.6.1\plugins\com.me.test\xsl\fo\topic2fo_shell_fop.xsl': I/O error reported by XML parser processing file:C:/DOTK/dita-ot-3.6.1/plugins/org.dita.pdf2.fop/cfg/fo/attrs/toc-attr_fop.xsl: C:\DOTK\dita-ot-3.6.1\plugins\org.dita.pdf2.fop\cfg\fo\attrs\toc-attr_fop.xsl (The system cannot find the file specified)

This was from creating a test plugin with all the defaults, not changing anything and a new clean DITA OT 3.6.1.

I think there might be a bug with the drop down box to select the DITA-OT version maybe? I did a test creating a plug for version 3.5 and 3.6 and doing a diff on the zip content, everything is exactly the same. If I selet 3.0 then the plugin.xml has transtype in the 3.5, but all the other content is the same and I would have expected some minor changes?

Also tried tested with DITA-OT 3.4.1 and 3.5.4, same error, which make sense as toc-attr_fop.xsl isn't in either of those versions.

Add support for variable reference in content

Add support for variable referenced in content key. Variable references format is

"{#" variable-name "}"

The generated stylesheet code will resolve to

<xsl:sequence select="dita-ot:get-variable(., variable-name, ())"/>

Incorrect attribute sets naming

In the section insertChapterFirstpageStaticContent, the 2 following attribute-sets/variables have the incorrect name, thus throwing an error at rendering:

chapterfrontmatternamecontainer should be __chapter__frontmatter__name__container
chapterfrontmatternumbercontainer should be __chapter__frontmatter__number__container

Here is a screenshot of how the plug-in gets generated (not all the instances):
Screenshot 1

Here is how it should be:
Screenshot 2

I used, DITA-OT version 2.4, XSL formatter AntennaHouse, And yes to Override shell.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.