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 scale macro to template #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

floswald
Copy link

with this macro, as per gnab/remark#72, one can now do

# A plot

```@example index
using Plots; gr()
Plots.plot(rand(10))
savefig("statplot.png");
```
![:scale 90%](statplot.png)

this solves my issue #9 at least somehow (it's not automatic, but it works).

with this macro, as per gnab/remark#72, one can now do 

````julia
# A plot

```@example index
using Plots; gr()
Plots.plot(rand(10))
savefig("statplot.png");
```
![:scale 90%](statplot.png)
````
@sffc
Copy link

sffc commented Sep 9, 2018

How about naming the macro img and keeping the alt text?

remark.macros.img = function (altText, width) {
  var url = this;
  return '<img alt="' + altText + '" src="' + url + '" style="width: ' + width + '" />';
};

Are there any other options we might want to support? Adding a macro like this to the main library means that it will be hard in the future to change it.

@piever
Copy link
Owner

piever commented Sep 10, 2018

Somehow I'm not sure we should add some specific macros here: if they didn't make it to Remark.js, then it's just confusing to have them here. OTOH it could be nice to add a way to add custom macros (either as a text file or a Julia string: I would tend to prefer the text file as there are no problems in escaping and it's easier for the user to write some normal javascript in a .js file with the highlighting provided by the editor).

So maybe the easiest is to allow the user to pass a filepath to macros keyword which would be used to define macros. Then this macro here (or maybe both) would go in the README as examples.

@tbeason
Copy link

tbeason commented Dec 11, 2020

Possible to revisit this?

@piever
Copy link
Owner

piever commented Dec 17, 2020

How do things work with plain Remark.js? Is the scale thing supported? If it is, just rebuilding Remark.jl should download the latest Remark.js and give support of the feature for free.

@tbeason
Copy link

tbeason commented Dec 18, 2020

Sorry, I meant the idea to include custom macros in general. I agree with what you said above about perhaps just somehow inserting an external file into the index as a good way to support it.

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

Successfully merging this pull request may close these issues.

None yet

4 participants