Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latex publisher and custom template not work! #614

Closed
MarcelGep opened this issue Dec 19, 2023 · 5 comments
Closed

Latex publisher and custom template not work! #614

MarcelGep opened this issue Dec 19, 2023 · 5 comments

Comments

@MarcelGep
Copy link

Hello together,
maybe i'm stupid but the latex publisher works not with a custom template?

I run
doorstop publish all ./dist --latex --template PATH/TO/TEMPLATE

and i get an Error
doorstop.common.DoorstopError: Template flag set, but no 'template' folder was found.

I try a template folder as parameter or a .tex file or a .html file but i get only this error.
What should i set as --template parameter?

(I'm using doorstop v3.0b10)

Update:
I look at the source code and the variable "document_template" (template.py) is always "None" because the "template" attribute of a document will never set and the parameter --template is never used only for if/else query.
I don't understand!!?!?!?

@neerdoc
Copy link
Collaborator

neerdoc commented Dec 19, 2023

Hi @MarcelGep,

I will look into it. Does it work with other output formats? E.g., if you use --markdown instead of --latex.

Kindly,
Gustav

@neerdoc
Copy link
Collaborator

neerdoc commented Dec 20, 2023

Hi @MarcelGep,

the problem is only very bad documentation from my part.

The --template flag is ment to set the name of the selected template only. You cannot place it anywhere other than in the template folder under the document structure. The reasoning behind that was simply to copy the methodology of the assets folder.

So, in your case: doorstop publish all ./dist --latex --template TEMPLATE_NAME means that you are actually trying to publish all documents in the standard doorstop folder, i.e., ./reqs. To correctly supply a custom template, you have to create a folder named template under the 'reqs' folder and in that folder place your template files.

reqs/
├── REQ001.yml
├── REQ002.yml
├── <snip>
├── assets
│   └── logo-black-white.png
└── template
    ├── TEMPLATE_NAME.cls
    └── TEMPLATE_NAME.yml

Please note that you have to supply both a .cls file and a .yml file and that the --template flag takes the name without any file ending.

I hope this helps, and I will try to update the documentation as soon as possible.

Kind regards,
Gustav

@MarcelGep
Copy link
Author

MarcelGep commented Dec 20, 2023

Hey @neerdoc
thanks for the response this way works 👍
With a correct documentation this will be perfect :-)

That means that i can add for each document folder a separate template folder and can using separate templates for each document?

├── swrs
│   ├── HEAD-1.0.yml
│   ├── HEAD-1.1.yml
│   ├── SWRS0001.yml
│   └── SWRS0002.yml
├── sys
│   ├── assets
│   │   └── autoware-logo.png
│   ├── HEAD-1.0.yml
│   ├── HEAD-1.1.yml
│   ├── HEAD-1.2.yml
│   ├── HEAD-1.3.yml
│   ├── SYS0001.yml
│   ├── SYS0002.yml
│   ├── SYS0003.yml
│   └── template
│       ├── logo-black-white.png
│       ├── template.cls
│       └── template.yml
└── template
    ├── logo-black-white.png
    ├── template.cls
    └── template.yml

@MarcelGep
Copy link
Author

MarcelGep commented Dec 20, 2023

Ok if i put only the "template" folder into the "reqs" folder it doesn't work!

doorstop.common.DoorstopError: Template flag set, but no 'template' folder was found.

It only works if i put the "template" folder into the document folder "sys" -> "reqs/sys/template".

├── swrs
│   ├── HEAD-1.0.yml
│   ├── HEAD-1.1.yml
│   ├── SWRS0001.yml
│   └── SWRS0002.yml
└── sys
    ├── assets
    │   └── autoware-logo.png
    ├── HEAD-1.0.yml
    ├── HEAD-1.1.yml
    ├── HEAD-1.2.yml
    ├── HEAD-1.3.yml
    ├── SYS0001.yml
    ├── SYS0002.yml
    ├── SYS0003.yml
    └── template
        ├── logo-black-white.png
        ├── template.cls
        └── template.yml

@jacebrowning
Copy link
Member

This beta release contains a fix for this issue: https://pypi.org/project/doorstop/3.0b11/ cc @neerdoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants