Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

github pages serve javascript / d3 visualizations

I'd like to serve javascript scripts and have them run such that people can go to my *.github.io page and see the visualizations there.

Is this possible? If so, how might I embed the javascript into the markdown?

like image 618
lollercoaster Avatar asked Oct 03 '14 05:10

lollercoaster


1 Answers

From the Markdown Syntax Overview:

For any markup that is not covered by Markdown’s syntax, you simply use HTML itself. There’s no need to preface it or delimit it to indicate that you’re switching from Markdown to HTML; you just use the tags.

I'm sure there's a better way to include scripts in your project, but if you really want to embed them in your markdown, there shouldn't be anything stopping 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>
like image 70
jshanley Avatar answered Sep 23 '22 14:09

jshanley