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

[v0.3.0] list #147

Closed
27 tasks done
tlienart opened this issue May 5, 2019 · 7 comments
Closed
27 tasks done

[v0.3.0] list #147

tlienart opened this issue May 5, 2019 · 7 comments
Labels
Milestone

Comments

@tlienart
Copy link
Owner

tlienart commented May 5, 2019

docs

  • document \\
  • document html entities and backslash escaping etc
  • document single, double and triple backticks
  • document indirect links (images and href) + that this [link text](https:://www.mozilla.org/ "Mozilla") is not supported (where the "Mozilla" bit should be the link title).
    • recommend not to use things that could clash with code so for instance, do not use [link][1] if there may be some place in your code with [1] otherwise both will be replaced and it'll be a mess. so either prefer inline links or use ids which don't clash.
  • document that headers should only be defined via #... (also for TOC generation)
  • indented code blocks, why fenced is better (risk of clashes with lists, doesn't have the eval possibility and somewhat less battle tested) but otherwise ok
  • document differences if come from other ssg (see Jekyll/JuDoc compatibility comments #201 and the last comment)
  • document use of lang local page variable for indented code blocks

think

  • either brainstorm or document; if something like `[...]: blah` is found it will be replaced (as per indirect link processing) though it shouldn't be because it's part of a code block; maybe we can just assume that won't happen too much and could offer a toggle to only have inline links (so no delayed links) in which case this wouldn't happen.

done

@tlienart tlienart added this to the 0.3+ milestone May 5, 2019
@asprionj
Copy link
Collaborator

asprionj commented May 5, 2019

The JuDoc site, generated with JuDoc, of course...?

@tlienart
Copy link
Owner Author

tlienart commented May 6, 2019

Of course 😄

@Invarianz
Copy link

Invarianz commented May 20, 2019

I think it would be nice to have some kind of integration with Weave.jl.
Especially the feature to evaluate code on the fly and put the output directly onto the webpage is a nice feature. Since the evaluation of functions in Weave.jl can be switched off or on for code blocks (or globally), it would not clash with your general idea; to not make code evaluation default as it slows down site generation.
Right now if I want to add code to my personal webpage (resembling REPL input and output) I use Weave.jl as an intermediate step to evaluate a block, generate a markdown page, change the code block name from julia to julia-repl and paste it into my JuDoc page. I think it would easily be possible to automatize this.

Great site generator by the way! I did not find any static webpage generator yet that has so many features necessary and suitable for scientists out of the box.

@tlienart
Copy link
Owner Author

tlienart commented May 21, 2019

Great site generator by the way! I did not find any static webpage generator yet that has so many features necessary and suitable for scientists out of the box.

Thanks!!

With respect to Weave.jl, I think effectively the original reasoning was that I didn't want to step on Documenter's or Weave's playground and indeed there was the potential issue of slowing down page generation. (Btw I was not aware that you could block code evaluation with Weave, I really should take a closer look at that package).

Here's a proposal for something that could be done, feedback would be great:

Possible approach

This would effectively just be a simple way to automatise the existing approach:

  1. find executable code blocks which could be marked as ```julia:script1
  2. copy the content of these blocks to assets/scripts/page_name/ with name script1.jl, if the file already exists, check whether the content matches and replace it if it doesn't
  3. unless we have {file was present && content unchanged && output file available}, run the script and capture its output
  4. same input approach as the current one

So from the user perspective, the markdown would look like

A simple line of code
```julia:script1
println(exp(1im*pi))
```
which leads to
\input{output}{script1}

This would slow down the generation of the page but assuming that the code blocks are not super complicated it should still be pretty quick (and I guess for slow code blocks one could still use the other method if they wanted).

Thoughts?

@Invarianz
Copy link

I believe that this is a nice solution. If we could add in the options comparable to Weave.jl like eval=true/false or term=true/false to evaluate and/or make it resemble a REPL session it would be perfect.
One thing to think about is the folder naming. If one has a growing webpage (with several subfolders in src/) the scripts folder could very fast start to overflow with folders and incorporated scripts. I personally like the idea to keep assets folders in subfolders of your src/ tree. So in my case it looks a bit like this:

src/pages/
         |- physics.md
         |- julia.md
         |- assets/
         |        |- scripts/
         |        |         |- script1.jl
         |        |- infra/
         |        |       |- rndimg.png
         |- physics/
         |         |- cdw.md
         |         |- assets/
         |         |        |- scripts/
         |         |        |         |- script1.jl
         |         |        |- infra/
         |         |        |       |- cdw.png
etc.

At least for met this creates a logical ordering of the scripts and images with respect to the order of my webpage.
In that sense I am not sure if the "global" assets folder is even necessary except for the first landing page.

@Invarianz
Copy link

Invarianz commented May 21, 2019

Another, seperate thing that I realised right now (since I started putting papers directly into the assets/ folders to organise them): I am not exactly sure about all the technical implications but wouldn't it make sense (at least for the live preview) to create softlinks in the assets/ folders in pub/ instead of copying the content over? I think this should give a significant perfomance increase when dealing with large files (big pdfs, images etc.).

@tlienart
Copy link
Owner Author

scripts eval

I've opened an issue to keep track of discussion: #152

assets in pub

I may have misunderstood your point but I'm guessing it may be related to the previous one: if you keep all auxiliary content in yourwebsite/assets/, it doesn't get copied over, and is available at username.github.io/assets/... for instance this file: https://tlienart.github.io/assets/csml/cvxopt/lsc-usc.svg.

Now if you put any non-markdown content in src/pages/... then it does indeed get copied over to pub/... (only once though, unless it gets changed). So it's true that if you had a massive PDF in src/pages/phys/massivePDF.pdf, in the initial pass it would get copied over to pub/pages/phys/massivePDF.pdf which could take time. But then I'd recommend just putting it once and for all in assets/phys/massivePDF.pdf in which case it never gets copied over.

This could be clarified in the docs, no doubt.

Thanks for the feedback!

This was referenced May 22, 2019
@tlienart tlienart added the wip label Sep 2, 2019
@tlienart tlienart changed the title [v0.3+] list [v0.3.0] list Sep 6, 2019
tlienart added a commit that referenced this issue Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants