So there is a lot out there about creating anchors in markdown, and creating internal table-of-contents-type anchors in a notebook. What I need though is the ability to access an anchor in my notebook on Github from an external source, e.g.:
https://github.com/.../mynotebook.ipynb#thiscell
I've got a number of interactive tutorials hosted this way, and a single manual that I want to be able to link to sections of the notebooks for. I can add the anchor tags into markdown cells just fine, using:
<a id='thiscell'></a>
but when I try using the link as I wrote above, it just loads the notebook at the top, as if there was no reference to an anchor.
GitHub renders notebooks using a separate domain, render.githubusercontent.com, and integrates the output in a nested frame. This means that any anchors on the GitHub URL won't work, because the framed document is a different URL entirely.
Moreover, the framed content is not easily re-usable, as the result is a cached rendering of the notebook with a limited lifetime. You can't rely on it sticking around for later linking!
So if you need to be able to link to sections in a notebook, you'd be far better off using the Jupyter notebook viewer service, https://nbviewer.jupyter.org/. It supports showing notebooks from any public URL including GitHub-hosted repositories and GitHub gists. You can also just enter your GitHub user name (or username/repository) for quick access.
This notebook viewer is far more feature-rich than the one GitHub uses. GitHub kills all embedded JavaScript, and strips almost all HTML attributes. Any embedded animations are right out. But the Jupyter nbviewer service supports those directly out of the box.
E.g. compare these two notebooks on nbviewer:
https://nbviewer.jupyter.org/github/mjpieters/adventofcode/blob/master/2018/Day%2020.ipynb
https://nbviewer.jupyter.org/github/mjpieters/adventofcode/blob/master/2018/Day%2021.ipynb
with the same notebooks on GitHub:
https://github.com/mjpieters/adventofcode/blob/master/2018/Day%2020.ipynb
https://github.com/mjpieters/adventofcode/blob/master/2018/Day%2021.ipynb
The first one contains an animation at the end, the second has a complicated table made easier to read by use of some HTML styling and anchor links.
I had the same problem. As a workaround, I have delegated the rendering of my notebook to http://nbviewer.jupyter.org. It's just a matter of providing its GitHub public url and clicking Go!
Of course, the internal links still don't work under GitHub, but I have now a functioning notebook somewhere on the web, which is what I actually wanted in the first place.
I hope this applies to your case too.
Related
I want to use my flowchart as a table of contents that also represents the progression of parallel events vaguely in chronological order and their relation to one another.
I know to create these charts using markdown. By adding the "click" line for the "B" node i can see my cursor change when hovering over the node as if it were a link but any attempt to select it doesn't work.
graph LR;
A-->B;
click B "http://www.github.com"
Is this a limitation of Gitlab itself?
Update:
This is now supported since GitLab 12.1.
The given example works in GitLab Wiki pages.
graph LR;
A-->B;
click B "http://www.github.com"
Thanks, KargWare for pointing this out in the comments.
Yes, this is a limitation of GitLab. There is an open issue requesting the feature:
https://gitlab.com/gitlab-org/gitlab-ce/issues/50459
Hopefully, it will be implemented eventually.
Not only the syntax is supported, but GitLab 15.2 (July 2022) adds:
Live preview diagrams in the wiki WYSIWYG editor
GitLab Flavored Markdown includes extensions to support Mermaid, PlantUML, and Kroki diagrams but writing anything other than the most basic diagrams can be cumbersome without a live preview.
You can toggle between the raw source and static preview and there are external tools you can use to write these diagrams, but the shift away from your content can be distracting.
GitLab 15.2 introduces a live rendered preview of your diagram in the wiki’s WYSIWYG editor.
Now, as you write your diagram in a specialized code block we will detect the diagram type and display a preview icon.
When enabled, the live preview renders above the code block and updates as you type, so you can ensure your formatting is correct and the output will be exactly what you expect.
See Documentation and Issue.
I've used GTM numerous times to fire LD-JSON business schema via a custom-html tag with Tag Manager. This time however, I'm running into issues.
The tags fire in the debug/preview mode of GTM, but when I publish it they are not found on the live site. Tag assistant shows no issues with the installation; I should add the custom HTML doesn't appear on the debug/preview, but the tag does fire (per the debugger).
The site in question uses WP-engine, but I've been told that's not likely the issue. If anyone can point me in a direction that would be great.
I posted on the product forums for google: https://productforums.google.com/forum/?utm_medium=email&utm_source=footer#!msg/tag-manager/RfxZcqbWrSg/wAWzn98TCwAJ
The issue here was GTM was using the 'document.write' feature for the custom HTML container (which housed the LD-JSON Schema). Removing that feature populated the site where Google could read the schema.
Props to Simo for being a 'sweet dude' for pointing this out.
I also faced one similar issue, and for me it was how google tag manager file was served from the app.
It was being served as
https://www.googletagmanager.com/gtag/.js?id=yourGtmId
instead of
https://www.googletagmanager.com/gtm.js?id=yourGtmId
Although in the preview mode, the correct file was being served somehow!
Just want to mention that I was having this problem also, and being new to adding custom HTML / JavaScript to my website through Google Tag Manager, I was completely oblivious to the fact that you must click the submit button in the top right of one of the main views (Overview, Tags, Triggers, etc.) in order to publish your changes. I was thinking that the save button within the trigger or tag was all that was needed.(Be sure that you are not forgetting this simple step!).
When building an MVC project, there's a shared folder automatically provided in which I have Layout.cshtml page that's used like the holder or master page (as it was called in Web Forms). So, all the banners, navbars, footers etc. go in there, while the acutal pages being developed refer to it in the source code and got pasted together upon rendition. This far I'm following.
Now, I have a set up and AspNet website using Yeoman and the only thing I have is wwwroot directory in which I put the file start.html. (It's the same as index.html - I just wanted to try out if I have full control over default files.)
I'm unsure how to proceed. I.e. I'd like the links on the start.html to point to files like uno.html, duo.html etc. and read those into a designated part of the landing page (i.e. start.html).
Is it doable without using the magic of templates? I want to have full control over the rendition process.
There's no point googling it, I noticed, because anything I've got the last two hours leads to how to create master page not to how to emulate master page.
Well, the static files middleware is just for that: static files.
You roughly have two options:
Do everything client sided, i.e. rather than having normal links use javascript/ajax calls and embed the content of the static file in your start.html using javascript.
It should work, but has several down-sites like it requires javascript to work (not a big issue these days, except for the paranoids who use no-script browser extensions) and that web crawler still may have issues properly indexing ajax heavy web pages
Wait until ASP.NET Core 1.2 (scheduled for Q1-Q2 2017), which will add Razor Pages. Pages rendered with Razor template engine, but without the need of a controller.
1.2
WebSockets
SignalR
Razor Pages (Views without MVC controllers)
Web API security
If you don't wanna wait, try RazorLight, which is 3rd party open source library for rendering Razor views.
But all except the first one require some "magic template engine".
You could of course write an server-sided includes (SSI) middleware which would be based on UseStaticFiles middleware and parse the file and include the html files server sided before returning it. There is nothing out of the box for it as far as I know.
Recently I've been tasked with redesigning a website for the current company I'm working at. I've been using weebly to make the site, and then exporting the HTML to be re-hosted on the company's servers.
However, I've noticed that some functionality in weebly's code has stopped working. I imagine this might be due to weebly hosting some elements on their own servers, but this is merely a beginners best guess.
1. The picture for the logo on the banner does not appear once the HTML is rehosted
For comparison, here's the site while hosted on weebly:
http://mjmacoustique.weebly.com/
and the site on the company's servers:
http://www.mjm.qc.ca/redesign2015/
When weebly hosts, the ''MJM'' image should be on the top left and function as a return to home page button when clicked. However, when it's hosted on the company's server, the image is not found.
2. On Firefox, the background image of the home page is replaced with an all black background
When opened in firefox, it fails to load the background image of the main page.
Any help or solutions to these problems would be greatly appreciated.
Thanks.
I can help with question #1: the logo is hosted on weebly's servers, but in the html it's written in a shortcut method like this example: /uploads/2/6/8/5/26851316/1434298489.png"
the easy workaround would be to keep the weebly version of the site working, in in the html change the src value of the missing images to something like this http://mjmacoustique.weebly.com/uploads/2/6/8/5/26851316/1434298489.png
So you haveto add the http://YOURSITE.weebly.com before all the src values of your images.
otherwise, just load all the images you need on a blank page of the site on your servers, copy image urls of those and replace the urls in the html with that.
Hope that helps?
The firefox issue might also be solved if all your src values are linked correctly but I cannot be sure about that.
When I tried exporting a site from weebly, some assets were missing from the zip it produced. This resulted in some images failing to appear because they simply weren't there. I don't know how often this happens (or if it happens only for some sites), but weebly's export feature definitely seems to have bugs.
I worked around this by using wget to recursively fetch the content that weebly was hosting. Then I hand-copied the missing assets (and only the missing assets) from the directory structure saved by wget and merged them into the directory structure from weebly's export zip. This is time-consuming, but necessary since the directory structure fetched by wget includes dynamically-generated content (meta data for weebly's editor, assets with decorated names, etc) that you probably don't want in the content you host elsewhere.
I managed to collect the behavior of a complex web site into a webarchive. Thereafter I would like to turn that webarchive into an html set of nested directory. Yet, when I did it both with Waf and with a commercial software bought on the the Apple store, what I get is just the nested directory with the html page at the bottom and no images, nor css nor working links.
If you are interested the webarchive document is at:
http://www.miafoto.it/it/GiroMilano.webarchive
while the weak product of the extraction is at:
http://www.miafoto.it/it/Giromilano/Pagine/default.aspx
and the empty directories above.
In addition to the different look, the webarchive displays the same behavior as the official web site - when a listbox vales is selected and then the button pushed - while the extracted version produces a page with no contents by loading itself rather than the official page.
As you may see the webarchive is over 1MB while the extraction just little over 1 KB.
What is wrong with it and how may I perform such an apparently trivial business with usable results?
Thanks,
textutil -convert html example.webarchive
Be careful — html with files is created in the same folder as webarchive!
Also, I had to open .html with text editor and replace "file:///image.tiff" links (replace "file:///" with "") so they point to relative path.
Also, not all browsers display .tiff images.
Who knew we have Stack Overflow wiki?
I find that this WebArchiveExtractor.app works on my Mac (Mojave OS) –
https://robrohan.github.io/WebArchiveExtractor/
I managed the issue by finding all parameters being submitted in the page and submitting them too in my script, ignoring the webarchive.
To save HTML pages on mac, I use chrome. Download and install it and save your page as HTML. Safari will save the web pages with webarchiveformat and for me, it's very hard to deal with it.