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

Stylesheet paths are not relative to the file they are in #37

Closed
simonhaenisch opened this issue Jun 12, 2019 · 4 comments · Fixed by #39
Closed

Stylesheet paths are not relative to the file they are in #37

simonhaenisch opened this issue Jun 12, 2019 · 4 comments · Fixed by #39
Labels
Projects

Comments

@simonhaenisch
Copy link
Owner

Hi

The relative path changed... it used to consider the relative path from the execution path, now, it considers relative path from the MD file.

It used to work with:

  "stylesheet": [
    ".\\mystyle.css"
  ],

when executed from c:\RepoFolderRoot\

Error is:

 md2pdf --config-file .\generate_pdf\config.json ./doc1/doc1.md
  × generating PDF from ./doc1/doc1.md
    → ENOENT: no such file or directory, open 'c:\RepoFolderRoot\doc1\mystyle.css'

and now works with...

  "stylesheet": [
    "C:\\RepoFolderRoot\\generate_pdf\\mystyle.css"
  ],

It is not very convenient for me, as my stylesheet lifecyle is different from doc lifecycle, and I'm not the only one to use this repo (and of course, all of us do not have the same folder organisation....)

Originally posted by @nekloth in #19 (comment)

@simonhaenisch
Copy link
Owner Author

@nekloth thanks for bringing this up, I think you're right that this is confusing... should probably resolve paths relative to the file they are in.

@nekloth
Copy link

nekloth commented Jun 12, 2019 via email

@simonhaenisch
Copy link
Owner Author

Well, I'm thinking if you're specifying a relative path:

  • in the config file, it should be relative to that config file
  • in the frontmatter of the md file, it should be relative to the md file
  • in the cli, it should be relative to the process cwd

@nekloth
Copy link

nekloth commented Jun 12, 2019

:) Sounds good and generic enough to satisfy lot of different use cases!

@simonhaenisch simonhaenisch added this to To Do in 3.0 Aug 16, 2019
@simonhaenisch simonhaenisch mentioned this issue Aug 27, 2019
Merged
8 tasks
3.0 automation moved this from To Do to Done Jan 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
3.0
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants