Git Product home page Git Product logo

fontawesome's People

Contributors

cderv avatar cscheid avatar jjallaire avatar mcanouil avatar mine-cetinkaya-rundel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fontawesome's Issues

Support more attributes in shortcodes for icon tag compatibility

I've discovered some curious behaviour when attempting to copy paste HTML code from the fontawesome site for use in quarto docs. Initially it appears that using the HTML syntax does not work. However, including at least one quarto syntax icon in the document allows both syntax types to render as expected. Below is a shell script to help reproduce the behaviour.

# filename="make-reprex.sh"
#!/usr/bin/env bash
# uname -v
# Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:43 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6000
# brew update
# brew install cask quarto
# echo `quarto --version`
# 1.3.450
mkdir broken-icon
cd broken-icon
quarto add quarto-ext/fontawesome
touch broken-icon-reprex.qmd
echo """---
title: Broken Icon Reprex
---
<i class=\"fa-regular fa-face-sad-tear fa-bounce fa-lg\"></i>
""" > broken-icon-reprex.qmd
quarto render broken-icon-reprex.qmd --output bad-icon.html
echo """
{{< fa brands python >}}

""" >> broken-icon-reprex.qmd
quarto render broken-icon-reprex.qmd --output fixed-icon.html

fontawesome not working with Quarto 0.9.644

Hi! Not sure whether to report as an issue or not but the fontawesome extension doesn't work with Quarto version 0.9.644 (and possibly any version <1.0?).

Steps to reproduce:

  1. Create website with quarto create-project mysite --type website
  2. Install fontawesome extension in the mysite folder with quarto install extension quarto-ext/fontawesome
  3. Edit index.qmd and add line {{< fa lemon >}}
  4. Run quarto preview mysite

The following returns this error:
Error running filter C:/Users/Paulius/AppData/Local/Programs/Quarto/share/filters/quarto-pre/quarto-pre.lua:
[string "---------------------------------------------..."]:1477: attempt to index a string value (local 'v')
stack traceback:
[string "---------------------------------------------..."]:1589: in field 'addHtmlDependency'
...ysite_extensions\quarto-ext\fontawesome\fontawesome.lua:6: in upvalue 'ensureHtmlDeps'
...ysite_extensions\quarto-ext\fontawesome\fontawesome.lua:57: in field 'handle'
.../Programs/Quarto/share/filters/quarto-pre/quarto-pre.lua:2906: in function 'callShortcodeHandler'
.../Programs/Quarto/share/filters/quarto-pre/quarto-pre.lua:2843: in function 'transformShortcodeBlocks'

Updating Quarto to latest resolved the issue. Perhaps a solution could be adding a version dependency that throws a prompt to update Quarto?

feature request: turn on linking without using shortcodes

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

Any plans to support the new Twitter/X Logo?

Hi folks!

As far as I can see the current fontawesome(-extention) can't display the new X Logo (formerly know as twitter). Does someone have a work around or will there be an update soon?

Yours
Norman

More icons?

Hi, thank you for this great extension.

Do you have information on which icons are included?
For example, rabbit does not seem to be available.

FEATURE: `style` key should optional in shortcode

Consider the following

{{< fa book style="color: #003262" title="Reading Assignment Icon" >}} 

This is evaluated to:

<i class="fa-solid fa-book" title="Reading Assignment Icon" aria-label="book">

Notice the style keyword that allows for color to be set is MIA.

The expected output would be:

<i class="fa-solid fa-book" style="color: #003262" title="Reading Assignment Icon" aria-label="book">

Though, glancing at the minimal example, I think the style keyword was intentionally omitted. Thus, this is more of a feature request than a bug report.

https://github.com/quarto-ext/fontawesome/blob/main/example.qmd

`aria-label` option won't override default for icon?

Perhaps this is stemming from a lack of knowledge on my part, but I'm having trouble specifying an aria-label for an icon obtained using shortcode. A simple example is: {{< fa volume-high title="listen" aria-label="listen" >}}. Running quarto preview and inspecting the source code for the icon in a web browser (I've tried both Firefox 114.0.1 and Safari 16.5), I get: <i class="fa-solid fa-volume-high" title="listen" aria-label="volume-high"></i>. It appears that the aria-label that I specified in the shortcode has failed to override the aria-label that is seemingly pre-associated with the icon. Is there any known way to specify my own aria-label in this way? I'm using quarto 1.3.433 on MacOS Ventura 13.4.

License notice?

Not limited to this repository, but if we install the quarto extension, our repository will include the filter scripts, etc., so it would be easier to handle if the License is written in each file, or _extension.yml.

Issue deploying to netlify

Hi,

I imagine this is an issue I have produced but just in case. Does this error log mean anything to you?

6:08:43 PM: ────────────────────────────────────────────────────────────────
6:08:43 PM: Plugin "@quarto/netlify-plugin-quarto" failed
6:08:43 PM: ────────────────────────────────────────────────────────────────
6:08:43 PM: ​
6:08:43 PM: Error message
6:08:43 PM: Error: Error message
6:08:43 PM: Command failed with exit code 1: /tmp/quarto/bin/quarto render (https://ntl.fyi/exit-code-1)
6:08:43 PM: [ 1/26] about.qmd
6:08:43 PM: Error running filter /tmp/quarto/share/filters/quarto-pre/quarto-pre.lua:
6:08:43 PM: _extensions/quarto-ext/fontawesome/fontawesome.lua:63: attempt to call a nil value (field 'is_format')
6:08:43 PM: stack traceback:
6:08:43 PM: /tmp/quarto/share/filters/quarto-pre/quarto-pre.lua:2943: in function 'callShortcodeHandler'
6:08:43 PM: /tmp/quarto/share/filters/quarto-pre/quarto-pre.lua:3024: in function 'transformShortcodeInlines'

It seems there is an error produced by the lua while running the extension and the traceback seems to relate to the shortcodes.

I am using the following code in the _quarto.yml to put fa icons in the navbar. Could that be the issue?

    left:
     - text: "{{< fa virus >}} Monkeypox"
        href: monkeypox.qmd

CI: Add GHA to publish rendered example on gh-pages?

I noticed the rendered examples are published on gh-pages but there isn't any CI allowing the files to be properly updated on code changes in main.
Should we (I) add something like:

on:
  push:
    branches: main

name: Quarto render examples

jobs:
  render-example:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v3
      - uses: quarto-dev/quarto-actions/setup@v2
      - name: Render and Publish
        uses: quarto-dev/quarto-actions/publish@v2
        with:
          GITHUB_USERNAME: ${{ github.actor }}
          GITHUB_EMAIL: ${{ github.actor }}@users.noreply.github.com
          target: gh-pages
          path: example.qmd
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

How to access "regular" fontawesome icons?

Some fontawesome icons appear in two styles, one of which is called "regular", and takes a [regular] optional argument in LaTeX. For example, \faIcon{square} is a filled square, whereas \faIcon[regular]{square} is an empty square. In HTML the two are differentiated by the class "far" vs "fas".

I searched through the documentation of this extension, but I don't find how to access these variants. Following the example of the size specification I tried adding style="regular" or regular=true and various other combinations. I was wondering if it is possible to access these variants and how.

Thank you so much for this awesome extension, it makes a world of difference!

Incorrect path to fonts generated with Quarto v1.2+

I'm not sure if this is an issue with this extension specifically or an issue with Quarto v1.2's handling of external HTML resources.

When using Quarto v1.1.251, the path to the font files that is generated in all.css (site_libs/quarto-contrib/fontawesome6-0.1.0/all.css) correctly references the files that are placed in the webfonts directory one level back:

@font-face {
  font-family: 'Font Awesome 6 Free';
  ...
  src: url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.ttf") format("truetype"); }

When using Quarto v1.2.134 (and earlier iterations of v1.2), the path does not include ../webfonts/, which makes the fonts fail to load in the browser:

@font-face {
  font-family: 'Font Awesome 6 Free';
  ...
  src: url("fa-regular-400.woff2") format("woff2"), url("fa-regular-400.ttf") format("truetype"); }

image

lua errors when trying to render revealjs with fontawesome extension

Error running filter C:/Program Files/Quarto/share/filters/quarto-pre/quarto-pre.lua:
_extensions/quarto-ext/fontawesome/fontawesome.lua:56: attempt to call a nil value (field 'is_format')
stack traceback:
...ram Files/Quarto/share/filters/quarto-pre/quarto-pre.lua:2943: in function 'callShortcodeHandler'
...ram Files/Quarto/share/filters/quarto-pre/quarto-pre.lua:3024: in function 'transformShortcodeInlines'

reprex follows

---
title: "A"
subtitle: "B"
author: "C"
institute: "D"
format: 
  revealjs:
    theme:
      - moon
    self-contained: true
from: markdown+emoji
---

## [Thank you]{style="font-weight:500"}

{{< fa envelope >}} [[email protected]](mailto:[email protected])

 

{{< fa brands github >}} [https://github.com](username)

 

{{< fa brands linkedin >}} [https://linkedin.com](handle)

Support Icon Sizes?

Hi team,

Thanks for this package, it has a lot of icons that I want that bootstrap doesn't include. Now that I've added some to my nav bar I notice they are smaller than the bootstrap icons, and I can't find a neat way to resize just those icons (although my css style knowledge is nonexistent).

Is adding support for icon sizes (https://fontawesome.com/docs/web/style/size) on the cards/consistent with the aims of the extension? Or is there a better alternative I'm unaware of?

I think it could be parsed in a very similar way as to what you just added for fa-brands, and I'd be willing to take a crack at a pull-request as long as I know the functionality is actually desired.

The only technical challenge I see is figuring out whether a two-argument shortcode contains a group and icon, or an icon and scale, but I think it would be easy to write regex to detect a scale.

FR: add color argument?

Hi, thanks for this great Quarto extension. It would be nice if we could add a color argument like so:

{{< fa brands r-project color=steelblue >}}

This has been implemented in https://github.com/schochastics/academicons and seems to work when adding the necessary lines to the lua filter for this extension. I'm happy to submit a PR to do that if you all think this is something worth adding.

Thanks!

Making this work in Quarto RevealJS in mermaid diagrams

Kia ora/hello from New Zealand.

I tried installing this and making it work with Quarto RevealJS. I found this thread and tried all of the options provided.

If I do this

```{mermaid}
%%| fig-width: 15
%%| fig-height: 5
flowchart LR
  A[{{< fa brands github size=5x >}}"Session :one:"] --> B{Decision}
  B --> C[just observe]
  B --> D[get involved]
  C --> E[get an overivew and hear buzzwords]
  D --> F[get hands-on experience]

I get (where the last bullet point reflects the use of an icon, but the mermaid doesn't render at all)
image

And this solutions doesn't work at all.
image

Any advice on how to get better logs is highly appreciated.

Cheers
Jens

No longer working with self contained: true

I'm using the latest dev version of quarto-cli. The fontawesome extension was working fine with self-contained: true but looks to have recently stopped working:

---
title: "Self contained true"
format: 
  html:
    self-contained: true
---

{{< fa thumbs-up >}}
{{< fa folder >}}
{{< fa chess-pawn >}}
{{< fa brands bluetooth >}}
{{< fa brands twitter size=2xl >}}
{{< fa brands github size=5x >}}
{{< fa battery-half size=Huge >}}
{{< fa envelope title="An envelope" >}}

Screen Shot 2022-08-22 at 8 45 53 pm

Self-contained false still works fine:

Screen Shot 2022-08-22 at 8 45 39 pm

Issue while compiling html with quarto and fontawesome

When trying to run a Quarto html document with the extension, I get the error.

output file: cv.knit.md

Error running filter C:/Users/Sarmiento/AppData/Local/Programs/Quarto/share/filters/quarto-pre/quarto-pre.lua:
_extensions/quarto-ext/fontawesome/fontawesome.lua:56: attempt to call a nil value (field 'is_format')
stack traceback:
.../Programs/Quarto/share/filters/quarto-pre/quarto-pre.lua:2943: in function 'callShortcodeHandler'
.../Programs/Quarto/share/filters/quarto-pre/quarto-pre.lua:3024: in function 'transformShortcodeInlines'
.../Programs/Quarto/share/filters/quarto-pre/quarto-pre.lua:2833: in function <.../Programs/Quarto/share/filters/quarto-pre/quarto-pre.lua:2827>
[C]: in function 'string.gsub'
.../Programs/Quarto/share/filters/quarto-pre/quarto-pre.lua:2827: in function 'transformShortcodeCode'

So you know how can I fix this error? or is it related to the extension itself?

Possibility to specify the color?

Is it possible to specify the colour for the FontAwesome icon? It would also be cool if it would be possible to use the Bootstrap primary color by default or at least make that an option as well as custom colors (like "red").

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.