{"id":3163,"date":"2016-02-16T03:25:39","date_gmt":"2016-02-16T03:25:39","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=3163"},"modified":"2016-02-16T03:25:39","modified_gmt":"2016-02-16T03:25:39","slug":"scaladoc-markdown-jekyll","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/","title":{"rendered":"Convert scaladoc output to Markdown and Jekyll"},"content":{"rendered":"<p>Scaladoc generates a listing page for every class you run it on.<\/p>\n<p>In this post, I&#8217;ll show how to convert the output of the entire API documentation (on the official scala site) to Markdown that is compatible with Jekyll (so that you can add \/ modify formatting as desired).<\/p>\n<p>I got the main scala library, forked it, and built from source. To do this, you will need some pre-requisites:<\/p>\n<pre lang=\"bash\">\nbrew update\nbrew install ant\nbrew install gem\ngem install jekyll\n<\/pre>\n<p>There is an ant target that lets you generate all of the scala documentation from source (this is what you&#8217;d need if you want to keep up with the nightly builds).<\/p>\n<pre lang=\"bash\">\ngit clone https:\/\/github.com\/garysieling\/scala.git\ncd scala\nant docs\n<\/pre>\n<p>This took ~40 minutes for me.<\/p>\n<p>To convert this to markdown, there is a handy library called <a href=\"https:\/\/github.com\/todesking\/nyandoc\n\">&#8220;nyandoc&#8221;<\/a>, but you need to install a scala dependency tracking thing called <a href=\"https:\/\/github.com\/n8han\/conscript\">&#8220;conscript&#8221;<\/a> first (this seems to be a wrapper around SBT).<\/p>\n<p>There are a couple ways to do this, and I had to fiddle with it to get it to work.<\/p>\n<p>You can either download the JAR and install or yolo it and get code directly from Github:<\/p>\n<pre>\ncurl https:\/\/raw.githubusercontent.com\/n8han\/conscript\/master\/setup.sh | sh\n<\/pre>\n<p>I had problems with both methods, but eventually got this to work.<\/p>\n<p>Once conscript installs it&#8217;s not on your path by default, but it&#8217;s not a big deal. You then install nyandoc with this command:<\/p>\n<pre lang=\"bash\">\n\/Users\/gary\/bin\/cs todesking\/nyandoc\nsbt launcher version 0.13.7\n\nConscripted todesking\/nyandoc to \/Users\/gary\/bin\/nyandoc\n<\/pre>\n<p>This tool is also not on your path.<\/p>\n<p>To convert to markdown, go into the folder where you build scala, and there will be a &#8220;library&#8221; folder that has the compiled scaladoc output.<\/p>\n<pre lang=\"bash\">\ncd scala\/build\/scaladoc\n\/Users\/gary\/bin\/nyandoc library library-markdown\n<\/pre>\n<p>The above command should only take a few minutes.<\/p>\n<p>Now, copy the output over to your jekyll site. <\/p>\n<pre lang=\"bash\">\ncp -R library-markdown ..\/..\/..\/scaladoc-jekyll\/_posts\/\ncd ..\/..\/..\/scala-jekyll\/_posts\n<\/pre>\n<p>Scaladoc output is a deeply nested folder structure. For this example the easiest thing to do is to flatten this:<\/p>\n<pre lang=\"bash\">\nfind *\/ -type f -exec bash -c 'file=${1#.\/}; echo mv \"$file\" \"${file\/\/\\\/\/_}\"' _ '{}' \\; > move_all.sh\nchmod +x .\/move_all.sh \nmv *.md ..\n<\/pre>\n<p>You still have a problem, because Jekyll expects a blog, with numbered blog posts.<\/p>\n<p>So, we can cheat the system by adding this:<\/p>\n<pre lang=\"bash\">\nls | sed \"s\/\\(.*\\)\/mv \\1 2016-02-15-\\1\/\" > move_all.sh\nchmod +x move_all.sh \n.\/move_all.sh\n<\/pre>\n<p>Now, you will have a Jekyll site with all the scala docs (one page per article).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Scaladoc generates a listing page for every class you run it on. In this post, I&#8217;ll show how to convert the output of the entire API documentation (on the official scala site) to Markdown that is compatible with Jekyll (so that you can add \/ modify formatting as desired). I got the main scala library, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Convert scaladoc output to Markdown and Jekyll&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[22],"tags":[480,486],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"Scaladoc generates a listing page for every class you run it on. In this post, I&#039;ll show how to convert the output of the entire API documentation (on the official scala site) to Markdown that is compatible with Jekyll (so that you can add \/ modify formatting as desired). I got the main scala library,\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"gary\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Gary Sieling - Software Engineer\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Convert scaladoc output to Markdown and Jekyll - Gary Sieling\" \/>\n\t\t<meta property=\"og:description\" content=\"Scaladoc generates a listing page for every class you run it on. In this post, I&#039;ll show how to convert the output of the entire API documentation (on the official scala site) to Markdown that is compatible with Jekyll (so that you can add \/ modify formatting as desired). I got the main scala library,\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2016-02-16T03:25:39+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2016-02-16T03:25:39+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Convert scaladoc output to Markdown and Jekyll - Gary Sieling\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Scaladoc generates a listing page for every class you run it on. In this post, I&#039;ll show how to convert the output of the entire API documentation (on the official scala site) to Markdown that is compatible with Jekyll (so that you can add \/ modify formatting as desired). I got the main scala library,\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/scaladoc-markdown-jekyll\\\/#blogposting\",\"name\":\"Convert scaladoc output to Markdown and Jekyll - Gary Sieling\",\"headline\":\"Convert scaladoc output to Markdown and Jekyll\",\"author\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\"},\"datePublished\":\"2016-02-16T03:25:39+00:00\",\"dateModified\":\"2016-02-16T03:25:39+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/scaladoc-markdown-jekyll\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/scaladoc-markdown-jekyll\\\/#webpage\"},\"articleSection\":\"Proof of Concepts, scala, scala-lang\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/scaladoc-markdown-jekyll\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.garysieling.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/proof-of-concepts\\\/#listItem\",\"name\":\"Proof of Concepts\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/proof-of-concepts\\\/#listItem\",\"position\":2,\"name\":\"Proof of Concepts\",\"item\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/proof-of-concepts\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/scaladoc-markdown-jekyll\\\/#listItem\",\"name\":\"Convert scaladoc output to Markdown and Jekyll\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/scaladoc-markdown-jekyll\\\/#listItem\",\"position\":3,\"name\":\"Convert scaladoc output to Markdown and Jekyll\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/proof-of-concepts\\\/#listItem\",\"name\":\"Proof of Concepts\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\",\"name\":\"Gary Sieling\",\"description\":\"Software Engineer\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/\",\"name\":\"gary\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/scaladoc-markdown-jekyll\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0be925276d848ffe98a6a9dc8cf33e67?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"gary\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/scaladoc-markdown-jekyll\\\/#webpage\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/scaladoc-markdown-jekyll\\\/\",\"name\":\"Convert scaladoc output to Markdown and Jekyll - Gary Sieling\",\"description\":\"Scaladoc generates a listing page for every class you run it on. In this post, I'll show how to convert the output of the entire API documentation (on the official scala site) to Markdown that is compatible with Jekyll (so that you can add \\\/ modify formatting as desired). I got the main scala library,\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/scaladoc-markdown-jekyll\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"datePublished\":\"2016-02-16T03:25:39+00:00\",\"dateModified\":\"2016-02-16T03:25:39+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/\",\"name\":\"Gary Sieling\",\"description\":\"Software Engineer\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Convert scaladoc output to Markdown and Jekyll - Gary Sieling","description":"Scaladoc generates a listing page for every class you run it on. In this post, I'll show how to convert the output of the entire API documentation (on the official scala site) to Markdown that is compatible with Jekyll (so that you can add \/ modify formatting as desired). I got the main scala library,","canonical_url":"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/#blogposting","name":"Convert scaladoc output to Markdown and Jekyll - Gary Sieling","headline":"Convert scaladoc output to Markdown and Jekyll","author":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"publisher":{"@id":"https:\/\/www.garysieling.com\/blog\/#organization"},"datePublished":"2016-02-16T03:25:39+00:00","dateModified":"2016-02-16T03:25:39+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/#webpage"},"isPartOf":{"@id":"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/#webpage"},"articleSection":"Proof of Concepts, scala, scala-lang"},{"@type":"BreadcrumbList","@id":"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.garysieling.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/proof-of-concepts\/#listItem","name":"Proof of Concepts"}},{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/proof-of-concepts\/#listItem","position":2,"name":"Proof of Concepts","item":"https:\/\/www.garysieling.com\/blog\/category\/proof-of-concepts\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/#listItem","name":"Convert scaladoc output to Markdown and Jekyll"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/#listItem","position":3,"name":"Convert scaladoc output to Markdown and Jekyll","previousItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/proof-of-concepts\/#listItem","name":"Proof of Concepts"}}]},{"@type":"Organization","@id":"https:\/\/www.garysieling.com\/blog\/#organization","name":"Gary Sieling","description":"Software Engineer","url":"https:\/\/www.garysieling.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author","url":"https:\/\/www.garysieling.com\/blog\/author\/gary\/","name":"gary","image":{"@type":"ImageObject","@id":"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/0be925276d848ffe98a6a9dc8cf33e67?s=96&d=identicon&r=g","width":96,"height":96,"caption":"gary"}},{"@type":"WebPage","@id":"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/#webpage","url":"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/","name":"Convert scaladoc output to Markdown and Jekyll - Gary Sieling","description":"Scaladoc generates a listing page for every class you run it on. In this post, I'll show how to convert the output of the entire API documentation (on the official scala site) to Markdown that is compatible with Jekyll (so that you can add \/ modify formatting as desired). I got the main scala library,","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.garysieling.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/#breadcrumblist"},"author":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"creator":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"datePublished":"2016-02-16T03:25:39+00:00","dateModified":"2016-02-16T03:25:39+00:00"},{"@type":"WebSite","@id":"https:\/\/www.garysieling.com\/blog\/#website","url":"https:\/\/www.garysieling.com\/blog\/","name":"Gary Sieling","description":"Software Engineer","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.garysieling.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Gary Sieling - Software Engineer","og:type":"article","og:title":"Convert scaladoc output to Markdown and Jekyll - Gary Sieling","og:description":"Scaladoc generates a listing page for every class you run it on. In this post, I'll show how to convert the output of the entire API documentation (on the official scala site) to Markdown that is compatible with Jekyll (so that you can add \/ modify formatting as desired). I got the main scala library,","og:url":"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/","article:published_time":"2016-02-16T03:25:39+00:00","article:modified_time":"2016-02-16T03:25:39+00:00","twitter:card":"summary_large_image","twitter:title":"Convert scaladoc output to Markdown and Jekyll - Gary Sieling","twitter:description":"Scaladoc generates a listing page for every class you run it on. In this post, I'll show how to convert the output of the entire API documentation (on the official scala site) to Markdown that is compatible with Jekyll (so that you can add \/ modify formatting as desired). I got the main scala library,"},"aioseo_meta_data":{"post_id":"3163","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2023-02-04 16:37:45","updated":"2026-07-06 01:27:36","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.garysieling.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.garysieling.com\/blog\/category\/proof-of-concepts\/\" title=\"Proof of Concepts\">Proof of Concepts<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tConvert scaladoc output to Markdown and Jekyll\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.garysieling.com\/blog"},{"label":"Proof of Concepts","link":"https:\/\/www.garysieling.com\/blog\/category\/proof-of-concepts\/"},{"label":"Convert scaladoc output to Markdown and Jekyll","link":"https:\/\/www.garysieling.com\/blog\/scaladoc-markdown-jekyll\/"}],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3163"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=3163"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3163\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=3163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=3163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=3163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}