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

Add support for lang directive #430

Closed
ludelafo opened this issue Aug 21, 2023 · 2 comments · Fixed by #446
Closed

Add support for lang directive #430

ludelafo opened this issue Aug 21, 2023 · 2 comments · Fixed by #446
Labels
upstream Depended on upstream

Comments

@ludelafo
Copy link

Hi Marp team!

I'm interested to use the hyphens CSS property as follow:

theme: gaia
style: |
    p {
        hyphens: auto;
    }

In order for this to work, I need to set the lang attribute.

marp-cli defines the argument lang in its options. When using the command-line tool as npx @marp-team/marp-cli@latest --lang en --pdf --output README.pdf README.md, the hyphens are correctly rendered.

I would like to add support for the lang directive in marp-vscode so the language of the document can be set:

theme: gaia
lang: en
style: |
    p {
        hyphens: auto;
    }

From my understanding of the codebase, the starting point would be https://github.com/marp-team/marp-vscode/blob/d9af184ed12b65bb28c0f328e250955d548ac1d1/src/directives/definitions.ts by adding a new directive such as:

  // Marp CLI metadata options
  createDirectiveInfo({
    name: 'lang',
    description: 'Set lang of the slide deck.',
    allowed: directiveAlwaysAllowed,
    providedBy: DirectiveProvidedBy.MarpCLI,
    type: DirectiveType.Global,
    details: 'https://github.com/marp-team/marp-cli#metadata', // Need to update the metadata as well
  }),

Would this feature be useful for marp-vscode? I would be glad to implement this feature if you are interested.

@yhatt
Copy link
Member

yhatt commented Aug 21, 2023

If so, the starting point would be Marp CLI rather than Marp for VS Code. Could you create an Issue in the Marp CLI repository to propose implementing lang global directive?
https://github.com/marp-team/marp-cli/issues

@ludelafo
Copy link
Author

Thank you very much @yhatt!

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

Successfully merging a pull request may close this issue.

2 participants