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

Nutshell + Franklin Rough Edges #971

Open
mcognetta opened this issue Aug 20, 2022 · 2 comments
Open

Nutshell + Franklin Rough Edges #971

mcognetta opened this issue Aug 20, 2022 · 2 comments

Comments

@mcognetta
Copy link
Contributor

mcognetta commented Aug 20, 2022

Carried over from Slack:

I've been playing with Nutshell after learning about it today: https://ncase.me/nutshell/
it works pretty well with Franklin, but there are a few rough edges that I've noticed. I'll start a thread with an MWE. If someone else could try these out that would be great!

At the bottom is an MWE that shows the few rough edges that I have encountered already. Namely:

  • Can't embed entire other pages from the same site (other sites work ok, which makes me think it's how Franklin produces the HTML headers): [:example][../posts/link_to_post]
  • Some Wikipedia links fail I found this is not caused by Franklin.
  • Some YouTube links fail I found this is not caused by Franklin.

So the only problem that really remains is embedding other pages from the same Franklin site. Embedding sections of other pages works as expected, but embedding the full page fails. Here is an example of what it looks like:

nutshell_franklin_relative_pages


MWE

@def title = "Nutshell + Franklin.jl"

# Nutshell + Franklin.jl

Add the following to your head.html file:

```html
  <script src="https://cdn.jsdelivr.net/gh/ncase/[email protected]/nutshell.min.js"></script>
```
### Relative Links

It does not seem to like embedding a full post from a relative link.

[:INSERT ANOTHER POST'S RELATIVE LINK HERE](<INSERT RELATIVE LINK>)

However, embedding a section from another page seems to work fine.

[:RELATIVE LINK PLUS SECTION](<INSERT RELATIVE LINK>#SECTION)

It looks like the problem is with Franklin's headers, as this works:
[:Nutshell Demo](https://ncase.me/nutshell/)
@mcognetta
Copy link
Contributor Author

Opened ncase/nutshell#13 to address the other issues.

@tlienart
Copy link
Owner

I had a quick look today

index.md :

~~~
<script src="https://cdn.jsdelivr.net/gh/ncase/[email protected]/nutshell.min.js"></script>
~~~

Attempt at nutshell

[:nutshell to foo](/foo/)

foo.md

# Foo

This is a post on another page

## Bar

Etc $1+1=2$.

Observed result
Screenshot 2022-08-25 at 10 31 52

So I think things work fine; just the relative link needs to be fully specified (/foo/ as opposed to foo).

Observe that the math doesn't work (even if you force hasmath=true on the parent page; I suspect this is to do with how nutshell handles the content; it means that it would not be compatible with maths or likely also highlighted code.

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

No branches or pull requests

2 participants