Github pages render javascript / d3

I would like to serve javascript scripts and run them so that people can go to my * .imtqy.com page and see the visualization there.

Is it possible? If so, how can I embed javascript in markdowns?

+5
source share
2 answers

From Markdown Syntax Overview :

For any markup that is not covered by Markdowns syntax, you simply use HTML. Theres no need to preface it or limit it to indicate that you are switching from Markdown to HTML; you just use tags.

I am sure that there is a better way to include scripts in your project, but if you really want to incorporate them into your markdown, there should be nothing to stop you from doing the following:

# This is a title > this is a blockquote <script> // this is a script that renders a chart var chart = d3.select('body').append('svg') // ...etc... </script> 
+6
source

Looks like you want to configure bl.ocks :

This is a simple viewer for sample code hosted on the GitHub Gist. Match the example with Gist and then point people here to view the example and source code, live!

The main source code for your example should be named index.html. You can also enable README.md with Markdown and thumbnail.png for preview. Index.html can use relative links to other files in your Gist; You can also use absolute links to shared files such as D3, jQuery and Leaflet.

Otherwise, you can insert data using an <iframe> .

+4
source

Source: https://habr.com/ru/post/1203919/


All Articles