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

feature request: turn on linking without using shortcodes #30

Open
EmilHvitfeldt opened this issue Sep 15, 2023 · 4 comments
Open

feature request: turn on linking without using shortcodes #30

EmilHvitfeldt opened this issue Sep 15, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@EmilHvitfeldt
Copy link

EmilHvitfeldt commented Sep 15, 2023

Sometimes I find myself using font awesome without need or ability to use short codes. E.i. programmatically constructed content.

I can turn on the linking with <div style="display:none;">{{< fa thumbs-up >}}</div> but that isn't super neat. without looking at the internals, being able to do something << fa activate=true >> would be nice way to link the files without adding an icon in the process

@cscheid
Copy link
Contributor

cscheid commented Sep 15, 2023

How is your programmatically-constructed content being created? Is it in Lua? In that case,

  quarto.doc.add_html_dependency({
    name = 'fontawesome6',
    version = '0.1.0',
    stylesheets = {'assets/css/all.css', 'assets/css/latex-fontsize.css'}
  })

should work. That's a bit of a hack, but it's what ensureHtmlDeps() does here: https://github.com/quarto-ext/fontawesome/blob/main/_extensions/fontawesome/fontawesome.lua

We don't want to do this to every project that declares this extension (for hopefully obvious reasons), but I agree that there should be a way to do it, including possibly a YAML header option..

@EmilHvitfeldt
Copy link
Author

latest example was when trying to add icons using css.

// this comes from the fontawesome docs: https://fontawesome.com/docs/web/setup/upgrade/pseudo-elements
.icon::before {
  display: inline-block;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
}

.reveal .live-code {
  h2::before {
      font-family: FontAwesome;
      content: "\f0e7";
      display: inline-block;
    }
}

@cscheid
Copy link
Contributor

cscheid commented Sep 15, 2023

Yeah, I think that the right way for us to do this, then, is to also embed a new filter that checks the document metadata and does the inclusion when requested.

@r-leyshon
Copy link

How is your programmatically-constructed content being created? Is it in Lua? In that case,

  quarto.doc.add_html_dependency({
    name = 'fontawesome6',
    version = '0.1.0',
    stylesheets = {'assets/css/all.css', 'assets/css/latex-fontsize.css'}
  })

should work. That's a bit of a hack, but it's what ensureHtmlDeps() does here: https://github.com/quarto-ext/fontawesome/blob/main/_extensions/fontawesome/fontawesome.lua

We don't want to do this to every project that declares this extension (for hopefully obvious reasons), but I agree that there should be a way to do it, including possibly a YAML header option..

+1 for YAML option to declare a fontawesome requirement in a doc or all pages in a website in the _quarto.yml

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

No branches or pull requests

4 participants