diff --git a/_data/comments/layout-comments/comment-1470944006665.yml b/_data/comments/layout-comments/comment-1470944006665.yml deleted file mode 100644 index fd4e1a7..0000000 --- a/_data/comments/layout-comments/comment-1470944006665.yml +++ /dev/null @@ -1,6 +0,0 @@ -message: "![Bill Murray](http://www.fillmurray.com/400/300)\r\n\r\n“It's hard to be an artist. It's hard to be anything. It's hard to be.”" -name: Bill Murray -email: b0caa2a71f5066b3d90711c224578c21 -url: '' -hidden: '' -date: '2016-08-11T19:33:25.928Z' diff --git a/_data/comments/layout-comments/comment-1470944162041.yml b/_data/comments/layout-comments/comment-1470944162041.yml deleted file mode 100644 index fb9b55e..0000000 --- a/_data/comments/layout-comments/comment-1470944162041.yml +++ /dev/null @@ -1,6 +0,0 @@ -message: "> “I never had seen Seinfeld, and they said, ‘Oh, it’s the last episode.’ And I said, ‘Oh, I’ll watch Seinfeld.’ And it was terrible.”\r\n>\r\n> *— From a 2014 interview with Howard Stern*" -name: Anonymous -email: 8c7e898f1b570760f834ecc03edf6b35 -url: '' -hidden: '' -date: '2016-08-11T19:36:01.033Z' diff --git a/_data/comments/markup-syntax-highlighting/comment-1470969665387.yml b/_data/comments/markup-syntax-highlighting/comment-1470969665387.yml deleted file mode 100644 index bc7a53f..0000000 --- a/_data/comments/markup-syntax-highlighting/comment-1470969665387.yml +++ /dev/null @@ -1,6 +0,0 @@ -message: "Here's a test comment with a Markdown code block:\r\n\r\n```scss\r\nh1, h2, h3, h4, h5, h6 {\r\n margin: 2em 0 0.5em;\r\n line-height: 1.2;\r\n font-family: $header-font-family;\r\n font-weight: bold;\r\n}\r\n```" -name: Michael Rose -email: 1ce71bc10b86565464b612093d89707e -url: 'https://mademistakes.com' -hidden: '' -date: '2016-08-12T02:41:04.706Z' diff --git a/_data/comments/welcome-to-jekyll/comment-1470942205700.yml b/_data/comments/welcome-to-jekyll/comment-1470942205700.yml deleted file mode 100644 index cde7395..0000000 --- a/_data/comments/welcome-to-jekyll/comment-1470942205700.yml +++ /dev/null @@ -1,6 +0,0 @@ -message: "This is a test comment with some **Markdown** sprinkled about for *testing purposes*.\r\n\r\n### Subheading in a comment? Madness!\r\n\r\nNam et risus nec ipsum efficitur facilisis. Aenean tincidunt dapibus odio, eget rutrum urna lacinia non. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas." -name: Michael Rose -email: 1ce71bc10b86565464b612093d89707e -url: 'https://mademistakes.com' -hidden: '' -date: '2016-08-11T19:03:24.929Z' diff --git a/_data/comments/welcome-to-jekyll/comment-1470942247755.yml b/_data/comments/welcome-to-jekyll/comment-1470942247755.yml deleted file mode 100644 index 8bc479e..0000000 --- a/_data/comments/welcome-to-jekyll/comment-1470942247755.yml +++ /dev/null @@ -1,6 +0,0 @@ -message: '"How much wood would a woodchuck chuck if a woodchuck could chuck wood?"' -name: Jackalope -email: cba827e665ae179e1d1ae007a6c3c1ab -url: '' -hidden: '' -date: '2016-08-11T19:04:06.958Z' diff --git a/_data/comments/welcome-to-jekyll/comment-1470942265819.yml b/_data/comments/welcome-to-jekyll/comment-1470942265819.yml deleted file mode 100644 index 58c506a..0000000 --- a/_data/comments/welcome-to-jekyll/comment-1470942265819.yml +++ /dev/null @@ -1,6 +0,0 @@ -message: '"How much wood would a woodchuck chuck if a woodchuck could chuck wood?"' -name: Jackalope Duplicate -email: cba827e665ae179e1d1ae007a6c3c1ab -url: '' -hidden: '' -date: '2016-08-11T19:04:25.085Z' diff --git a/_data/comments/welcome-to-jekyll/comment-1470942493518.yml b/_data/comments/welcome-to-jekyll/comment-1470942493518.yml deleted file mode 100644 index 68882dc..0000000 --- a/_data/comments/welcome-to-jekyll/comment-1470942493518.yml +++ /dev/null @@ -1,6 +0,0 @@ -message: "Images can be added to a comment using Markdown like this\r\n\r\n```\r\n![Bill Murray](http://www.fillmurray.com/600/400)\r\n```\r\n![Bill Murray](http://www.fillmurray.com/600/400)" -name: Michael Rose -email: 1ce71bc10b86565464b612093d89707e -url: 'https://mademistakes.com' -hidden: '' -date: '2016-08-11T19:08:12.789Z' diff --git a/_drafts/post-draft.md b/_drafts/post-draft.md deleted file mode 100644 index e0bb2bd..0000000 --- a/_drafts/post-draft.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -layout: single -title: "Draft Post" -header: - teaser: "unsplash-gallery-image-2-th.jpg" -categories: - - Jekyll -tags: - - edge case ---- -Monocle ipsum dolor sit amet handsome pariatur aliqua, hub remarkable irure commodo classic deserunt bespoke. Sunt commodo signature, Swiss minim flat white Tsutaya excepteur artisanal et Nordic laborum joy ANA. Beams mollit exquisite Ginza efficient dolore qui Comme des Garçons Winkreative Lufthansa bulletin global. Iconic sed liveable duis. Mollit dolore eu laboris Comme des Garçons hub pintxos sed eiusmod tote bag Shinkansen nisi consectetur pariatur. Nordic international quis finest Baggu dolore, bureaux hub hand-crafted ut joy sint Airbus A380. - -Conversation handsome hub cosy, enim emerging sed K-pop velit Gaggenau charming proident et boulevard ryokan. Remarkable airport deserunt international est, nulla minim magna emerging discerning in exclusive dolor. Commodo dolore deserunt cosy, global Nordic culpa uniforms signature charming. Smart ryokan commodo, eiusmod global occaecat incididunt aliqua Beams. Boulevard conversation excepteur finest Swiss non veniam Comme des Garçons essential artisanal. Destination Scandinavian international, anim Boeing 787 in duis Baggu irure essential. - -Fugiat exclusive laborum, Gaggenau ad Winkreative sharp elit labore. Remarkable officia ryokan Boeing 787, consectetur boutique Nordic Singapore espresso elit iconic perfect izakaya soft power excepteur. Ut veniam carefully curated K-pop dolore, uniforms in voluptate. Craftsmanship Ettinger Lufthansa sophisticated esse boutique veniam exquisite. Aute cillum bespoke, intricate consectetur in exquisite international lovely bulletin irure Washlet Gaggenau deserunt. Efficient eu quality of life wardrobe labore, dolor emerging airport concierge reprehenderit izakaya dolore liveable Baggu. - -Commodo elegant essential consectetur Gaggenau culpa consequat id sophisticated St Moritz sunt conversation duis non velit. Nulla business class non ut Marylebone ANA soft power fugiat carefully curated. Bureaux sed punctual handsome Washlet impeccable hand-crafted aute extraordinary tote bag enim boulevard soft power sleepy. Dolore conversation irure Zürich the best adipisicing, vibrant finest hub anim premium aliqua. Cupidatat smart international, bureaux Baggu id efficient punctual. Tempor nulla flat white enim, K-pop incididunt elit efficient Toto uniforms concierge discerning. Concierge sleepy extraordinary, deserunt Melbourne commodo Nordic Winkreative Washlet Ginza exercitation espresso. - -Tsutaya sed in business class sharp. Do Beams in adipisicing Lufthansa. Business class occaecat Melbourne, irure Singapore commodo espresso carefully curated quis quality of life adipisicing. Impeccable laborum efficient classic proident in. Beams Helsinki ullamco Marylebone dolore sophisticated concierge Muji anim duis joy ut. Comme des Garçons aute Muji in aliquip ryokan soft power Nordic essential ANA culpa elegant. \ No newline at end of file diff --git a/_posts/2012-08-14-blog-post-1.md b/_posts/2012-08-14-blog-post-1.md deleted file mode 100644 index 8d4819a..0000000 --- a/_posts/2012-08-14-blog-post-1.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: 'Blog Post number 1' -date: 2012-08-14 -permalink: /posts/2012/08/blog-post-1/ -tags: - - cool posts - - category1 - - category2 ---- - -This is a sample blog post. Lorem ipsum I can't remember the rest of lorem ipsum and don't have an internet connection right now. Testing testing testing this blog post. Blog posts are cool. - -Headings are cool -====== - -You can have many headings -====== - -Aren't headings cool? ------- \ No newline at end of file diff --git a/_posts/2013-08-14-blog-post-2.md b/_posts/2013-08-14-blog-post-2.md deleted file mode 100644 index f5c960d..0000000 --- a/_posts/2013-08-14-blog-post-2.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: 'Blog Post number 2' -date: 2013-08-14 -permalink: /posts/2013/08/blog-post-2/ -tags: - - cool posts - - category1 - - category2 ---- - -This is a sample blog post. Lorem ipsum I can't remember the rest of lorem ipsum and don't have an internet connection right now. Testing testing testing this blog post. Blog posts are cool. - -Headings are cool -====== - -You can have many headings -====== - -Aren't headings cool? ------- \ No newline at end of file diff --git a/_posts/2014-08-14-blog-post-3.md b/_posts/2014-08-14-blog-post-3.md deleted file mode 100644 index 83175c7..0000000 --- a/_posts/2014-08-14-blog-post-3.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: 'Blog Post number 3' -date: 2014-08-14 -permalink: /posts/2014/08/blog-post-3/ -tags: - - cool posts - - category1 - - category2 ---- - -This is a sample blog post. Lorem ipsum I can't remember the rest of lorem ipsum and don't have an internet connection right now. Testing testing testing this blog post. Blog posts are cool. - -Headings are cool -====== - -You can have many headings -====== - -Aren't headings cool? ------- \ No newline at end of file diff --git a/_posts/2015-08-14-blog-post-4.md b/_posts/2015-08-14-blog-post-4.md deleted file mode 100644 index 9e882e6..0000000 --- a/_posts/2015-08-14-blog-post-4.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: 'Blog Post number 4' -date: 2015-08-14 -permalink: /posts/2012/08/blog-post-4/ -tags: - - cool posts - - category1 - - category2 ---- - -This is a sample blog post. Lorem ipsum I can't remember the rest of lorem ipsum and don't have an internet connection right now. Testing testing testing this blog post. Blog posts are cool. - -Headings are cool -====== - -You can have many headings -====== - -Aren't headings cool? ------- \ No newline at end of file diff --git a/_posts/2199-01-01-future-post.md b/_posts/2199-01-01-future-post.md deleted file mode 100644 index e96eb5e..0000000 --- a/_posts/2199-01-01-future-post.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: 'Future Blog Post' -date: 2199-01-01 -permalink: /posts/2012/08/blog-post-4/ -tags: - - cool posts - - category1 - - category2 ---- - -This post will show up by default. To disable scheduling of future posts, edit `config.yml` and set `future: false`. diff --git a/_publications/2009-10-01-paper-title-number-1.md b/_publications/2009-10-01-paper-title-number-1.md deleted file mode 100644 index ca6a157..0000000 --- a/_publications/2009-10-01-paper-title-number-1.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "Paper Title Number 1" -collection: publications -permalink: /publication/2009-10-01-paper-title-number-1 -excerpt: 'This paper is about the number 1. The number 2 is left for future work.' -date: 2009-10-01 -venue: 'Journal 1' -paperurl: 'http://academicpages.github.io/files/paper1.pdf' -citation: 'Your Name, You. (2009). "Paper Title Number 1." Journal 1. 1(1).' ---- -This paper is about the number 1. The number 2 is left for future work. - -[Download paper here](http://academicpages.github.io/files/paper1.pdf) - -Recommended citation: Your Name, You. (2009). "Paper Title Number 1." Journal 1. 1(1). \ No newline at end of file diff --git a/_publications/2010-10-01-paper-title-number-2.md b/_publications/2010-10-01-paper-title-number-2.md deleted file mode 100644 index f1be921..0000000 --- a/_publications/2010-10-01-paper-title-number-2.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "Paper Title Number 2" -collection: publications -permalink: /publication/2010-10-01-paper-title-number-2 -excerpt: 'This paper is about the number 2. The number 3 is left for future work.' -date: 2010-10-01 -venue: 'Journal 1' -paperurl: 'http://academicpages.github.io/files/paper2.pdf' -citation: 'Your Name, You. (2010). "Paper Title Number 2." Journal 1. 1(2).' ---- -This paper is about the number 2. The number 3 is left for future work. - -[Download paper here](http://academicpages.github.io/files/paper2.pdf) - -Recommended citation: Your Name, You. (2010). "Paper Title Number 2." Journal 1. 1(2). \ No newline at end of file diff --git a/_publications/2015-10-01-paper-title-number-3.md b/_publications/2015-10-01-paper-title-number-3.md deleted file mode 100644 index 57e7b8d..0000000 --- a/_publications/2015-10-01-paper-title-number-3.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "Paper Title Number 3" -collection: publications -permalink: /publication/2015-10-01-paper-title-number-3 -excerpt: 'This paper is about the number 3. The number 4 is left for future work.' -date: 2015-10-01 -venue: 'Journal 1' -paperurl: 'http://academicpages.github.io/files/paper3.pdf' -citation: 'Your Name, You. (2015). "Paper Title Number 3." Journal 1. 1(3).' ---- -This paper is about the number 3. The number 4 is left for future work. - -[Download paper here](http://academicpages.github.io/files/paper3.pdf) - -Recommended citation: Your Name, You. (2015). "Paper Title Number 3." Journal 1. 1(3). \ No newline at end of file diff --git a/images/3953273590_704e3899d5_m.jpg b/images/3953273590_704e3899d5_m.jpg deleted file mode 100644 index 50d2155..0000000 Binary files a/images/3953273590_704e3899d5_m.jpg and /dev/null differ diff --git a/images/500x300.png b/images/500x300.png deleted file mode 100644 index f9fba92..0000000 Binary files a/images/500x300.png and /dev/null differ diff --git a/images/bio-photo-2.jpg b/images/bio-photo-2.jpg deleted file mode 100644 index a6f2035..0000000 Binary files a/images/bio-photo-2.jpg and /dev/null differ diff --git a/images/bio-photo.jpg b/images/bio-photo.jpg deleted file mode 100644 index 0008451..0000000 Binary files a/images/bio-photo.jpg and /dev/null differ diff --git a/images/browserconfig.xml b/images/browserconfig.xml deleted file mode 100644 index ff77e23..0000000 --- a/images/browserconfig.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - #000000 - - - diff --git a/images/editing-talk.png b/images/editing-talk.png deleted file mode 100644 index 9f15183..0000000 Binary files a/images/editing-talk.png and /dev/null differ diff --git a/images/foo-bar-identity-th.jpg b/images/foo-bar-identity-th.jpg deleted file mode 100644 index 49906ac..0000000 Binary files a/images/foo-bar-identity-th.jpg and /dev/null differ diff --git a/images/foo-bar-identity.jpg b/images/foo-bar-identity.jpg deleted file mode 100644 index d946815..0000000 Binary files a/images/foo-bar-identity.jpg and /dev/null differ diff --git a/images/image-alignment-1200x4002.jpg b/images/image-alignment-1200x4002.jpg deleted file mode 100644 index 8e3137c..0000000 Binary files a/images/image-alignment-1200x4002.jpg and /dev/null differ diff --git a/images/image-alignment-150x150.jpg b/images/image-alignment-150x150.jpg deleted file mode 100644 index d3b0e48..0000000 Binary files a/images/image-alignment-150x150.jpg and /dev/null differ diff --git a/images/image-alignment-300x200.jpg b/images/image-alignment-300x200.jpg deleted file mode 100644 index 3921878..0000000 Binary files a/images/image-alignment-300x200.jpg and /dev/null differ diff --git a/images/image-alignment-580x300.jpg b/images/image-alignment-580x300.jpg deleted file mode 100644 index 75bf08e..0000000 Binary files a/images/image-alignment-580x300.jpg and /dev/null differ diff --git a/images/manifest.json b/images/manifest.json deleted file mode 100644 index d641c30..0000000 --- a/images/manifest.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "Minimal Mistakes", - "icons": [ - { - "src": "\/images\/android-chrome-36x36.png?v=M44lzPylqQ", - "sizes": "36x36", - "type": "image\/png", - "density": 0.75 - }, - { - "src": "\/images\/android-chrome-48x48.png?v=M44lzPylqQ", - "sizes": "48x48", - "type": "image\/png", - "density": 1 - }, - { - "src": "\/images\/android-chrome-72x72.png?v=M44lzPylqQ", - "sizes": "72x72", - "type": "image\/png", - "density": 1.5 - }, - { - "src": "\/images\/android-chrome-96x96.png?v=M44lzPylqQ", - "sizes": "96x96", - "type": "image\/png", - "density": 2 - }, - { - "src": "\/images\/android-chrome-144x144.png?v=M44lzPylqQ", - "sizes": "144x144", - "type": "image\/png", - "density": 3 - }, - { - "src": "\/images\/android-chrome-192x192.png?v=M44lzPylqQ", - "sizes": "192x192", - "type": "image\/png", - "density": 4 - } - ] -} diff --git a/images/mstile-144x144.png b/images/mstile-144x144.png deleted file mode 100644 index c3d8317..0000000 Binary files a/images/mstile-144x144.png and /dev/null differ diff --git a/images/mstile-150x150.png b/images/mstile-150x150.png deleted file mode 100644 index c7a3c08..0000000 Binary files a/images/mstile-150x150.png and /dev/null differ diff --git a/images/mstile-310x150.png b/images/mstile-310x150.png deleted file mode 100644 index 25fd7ba..0000000 Binary files a/images/mstile-310x150.png and /dev/null differ diff --git a/images/mstile-310x310.png b/images/mstile-310x310.png deleted file mode 100644 index 1a75b7f..0000000 Binary files a/images/mstile-310x310.png and /dev/null differ diff --git a/images/mstile-70x70.png b/images/mstile-70x70.png deleted file mode 100644 index 88b5c25..0000000 Binary files a/images/mstile-70x70.png and /dev/null differ diff --git a/images/paragraph-indent.png b/images/paragraph-indent.png deleted file mode 100644 index b4a2c48..0000000 Binary files a/images/paragraph-indent.png and /dev/null differ diff --git a/images/paragraph-no-indent.png b/images/paragraph-no-indent.png deleted file mode 100644 index 3e0f9d2..0000000 Binary files a/images/paragraph-no-indent.png and /dev/null differ diff --git a/images/profile.png b/images/profile.png deleted file mode 100644 index 9435789..0000000 Binary files a/images/profile.png and /dev/null differ diff --git a/images/safari-pinned-tab.svg b/images/safari-pinned-tab.svg deleted file mode 100644 index d517ee1..0000000 --- a/images/safari-pinned-tab.svg +++ /dev/null @@ -1,34 +0,0 @@ - - - - -Created by potrace 1.11, written by Peter Selinger 2001-2013 - - - - - - - diff --git a/images/site-logo.png b/images/site-logo.png deleted file mode 100644 index 251dd22..0000000 Binary files a/images/site-logo.png and /dev/null differ diff --git a/markdown_generator/PubsFromBib.ipynb b/markdown_generator/PubsFromBib.ipynb deleted file mode 100644 index df898a7..0000000 --- a/markdown_generator/PubsFromBib.ipynb +++ /dev/null @@ -1,223 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Publications markdown generator for academicpages\n", - "\n", - "Takes a set of bibtex of publications and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_jupyter.html)). \n", - "\n", - "The core python code is also in `pubsFromBibs.py`. \n", - "Run either from the `markdown_generator` folder after replacing updating the publist dictionary with:\n", - "* bib file names\n", - "* specific venue keys based on your bib file preferences\n", - "* any specific pre-text for specific files\n", - "* Collection Name (future feature)\n", - "\n", - "TODO: Make this work with other databases of citations, \n", - "TODO: Merge this with the existing TSV parsing solution" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from pybtex.database.input import bibtex\n", - "import pybtex.database.input.bibtex \n", - "from time import strptime\n", - "import string\n", - "import html\n", - "import os\n", - "import re" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "#todo: incorporate different collection types rather than a catch all publications, requires other changes to template\n", - "publist = {\n", - " \"proceeding\": {\n", - " \"file\" : \"proceedings.bib\",\n", - " \"venuekey\": \"booktitle\",\n", - " \"venue-pretext\": \"In the proceedings of \",\n", - " \"collection\" : {\"name\":\"publications\",\n", - " \"permalink\":\"/publication/\"}\n", - " \n", - " },\n", - " \"journal\":{\n", - " \"file\": \"pubs.bib\",\n", - " \"venuekey\" : \"journal\",\n", - " \"venue-pretext\" : \"\",\n", - " \"collection\" : {\"name\":\"publications\",\n", - " \"permalink\":\"/publication/\"}\n", - " } \n", - "}" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "html_escape_table = {\n", - " \"&\": \"&\",\n", - " '\"': \""\",\n", - " \"'\": \"'\"\n", - " }\n", - "\n", - "def html_escape(text):\n", - " \"\"\"Produce entities within text.\"\"\"\n", - " return \"\".join(html_escape_table.get(c,c) for c in text)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "scrolled": false - }, - "outputs": [], - "source": [ - "for pubsource in publist:\n", - " parser = bibtex.Parser()\n", - " bibdata = parser.parse_file(publist[pubsource][\"file\"])\n", - "\n", - " #loop through the individual references in a given bibtex file\n", - " for bib_id in bibdata.entries:\n", - " #reset default date\n", - " pub_year = \"1900\"\n", - " pub_month = \"01\"\n", - " pub_day = \"01\"\n", - " \n", - " b = bibdata.entries[bib_id].fields\n", - " \n", - " try:\n", - " pub_year = f'{b[\"year\"]}'\n", - "\n", - " #todo: this hack for month and day needs some cleanup\n", - " if \"month\" in b.keys(): \n", - " if(len(b[\"month\"])<3):\n", - " pub_month = \"0\"+b[\"month\"]\n", - " pub_month = pub_month[-2:]\n", - " elif(b[\"month\"] not in range(12)):\n", - " tmnth = strptime(b[\"month\"][:3],'%b').tm_mon \n", - " pub_month = \"{:02d}\".format(tmnth) \n", - " else:\n", - " pub_month = str(b[\"month\"])\n", - " if \"day\" in b.keys(): \n", - " pub_day = str(b[\"day\"])\n", - "\n", - " \n", - " pub_date = pub_year+\"-\"+pub_month+\"-\"+pub_day\n", - " \n", - " #strip out {} as needed (some bibtex entries that maintain formatting)\n", - " clean_title = b[\"title\"].replace(\"{\", \"\").replace(\"}\",\"\").replace(\"\\\\\",\"\").replace(\" \",\"-\") \n", - "\n", - " url_slug = re.sub(\"\\\\[.*\\\\]|[^a-zA-Z0-9_-]\", \"\", clean_title)\n", - " url_slug = url_slug.replace(\"--\",\"-\")\n", - "\n", - " md_filename = (str(pub_date) + \"-\" + url_slug + \".md\").replace(\"--\",\"-\")\n", - " html_filename = (str(pub_date) + \"-\" + url_slug).replace(\"--\",\"-\")\n", - "\n", - " #Build Citation from text\n", - " citation = \"\"\n", - "\n", - " #citation authors - todo - add highlighting for primary author?\n", - " for author in bibdata.entries[bib_id].persons[\"author\"]:\n", - " citation = citation+\" \"+author.first_names[0]+\" \"+author.last_names[0]+\", \"\n", - "\n", - " #citation title\n", - " citation = citation + \"\\\"\" + html_escape(b[\"title\"].replace(\"{\", \"\").replace(\"}\",\"\").replace(\"\\\\\",\"\")) + \".\\\"\"\n", - "\n", - " #add venue logic depending on citation type\n", - " venue = publist[pubsource][\"venue-pretext\"]+b[publist[pubsource][\"venuekey\"]].replace(\"{\", \"\").replace(\"}\",\"\").replace(\"\\\\\",\"\")\n", - "\n", - " citation = citation + \" \" + html_escape(venue)\n", - " citation = citation + \", \" + pub_year + \".\"\n", - "\n", - " \n", - " ## YAML variables\n", - " md = \"---\\ntitle: \\\"\" + html_escape(b[\"title\"].replace(\"{\", \"\").replace(\"}\",\"\").replace(\"\\\\\",\"\")) + '\"\\n'\n", - " \n", - " md += \"\"\"collection: \"\"\" + publist[pubsource][\"collection\"][\"name\"]\n", - "\n", - " md += \"\"\"\\npermalink: \"\"\" + publist[pubsource][\"collection\"][\"permalink\"] + html_filename\n", - " \n", - " note = False\n", - " if \"note\" in b.keys():\n", - " if len(str(b[\"note\"])) > 5:\n", - " md += \"\\nexcerpt: '\" + html_escape(b[\"note\"]) + \"'\"\n", - " note = True\n", - "\n", - " md += \"\\ndate: \" + str(pub_date) \n", - "\n", - " md += \"\\nvenue: '\" + html_escape(venue) + \"'\"\n", - " \n", - " url = False\n", - " if \"url\" in b.keys():\n", - " if len(str(b[\"url\"])) > 5:\n", - " md += \"\\npaperurl: '\" + b[\"url\"] + \"'\"\n", - " url = True\n", - "\n", - " md += \"\\ncitation: '\" + html_escape(citation) + \"'\"\n", - "\n", - " md += \"\\n---\"\n", - "\n", - " \n", - " ## Markdown description for individual page\n", - " if note:\n", - " md += \"\\n\" + html_escape(b[\"note\"]) + \"\\n\"\n", - "\n", - " if url:\n", - " md += \"\\n[Access paper here](\" + b[\"url\"] + \"){:target=\\\"_blank\\\"}\\n\" \n", - " else:\n", - " md += \"\\nUse [Google Scholar](https://scholar.google.com/scholar?q=\"+html.escape(clean_title.replace(\"-\",\"+\"))+\"){:target=\\\"_blank\\\"} for full citation\"\n", - "\n", - " md_filename = os.path.basename(md_filename)\n", - "\n", - " with open(\"../_publications/\" + md_filename, 'w') as f:\n", - " f.write(md)\n", - " print(f'SUCESSFULLY PARSED {bib_id}: \\\"', b[\"title\"][:60],\"...\"*(len(b['title'])>60),\"\\\"\")\n", - " # field may not exist for a reference\n", - " except KeyError as e:\n", - " print(f'WARNING Missing Expected Field {e} from entry {bib_id}: \\\"', b[\"title\"][:30],\"...\"*(len(b['title'])>30),\"\\\"\")\n", - " continue\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.1" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/markdown_generator/publications.ipynb b/markdown_generator/publications.ipynb deleted file mode 100644 index 8657e10..0000000 --- a/markdown_generator/publications.ipynb +++ /dev/null @@ -1,371 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "deletable": true, - "editable": true - }, - "source": [ - "# Publications markdown generator for academicpages\n", - "\n", - "Takes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_jupyter.html)). The core python code is also in `publications.py`. Run either from the `markdown_generator` folder after replacing `publications.tsv` with one containing your data.\n", - "\n", - "TODO: Make this work with BibTex and other databases of citations, rather than Stuart's non-standard TSV format and citation style.\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Data format\n", - "\n", - "The TSV needs to have the following columns: pub_date, title, venue, excerpt, citation, site_url, and paper_url, with a header at the top. \n", - "\n", - "- `excerpt` and `paper_url` can be blank, but the others must have values. \n", - "- `pub_date` must be formatted as YYYY-MM-DD.\n", - "- `url_slug` will be the descriptive part of the .md file and the permalink URL for the page about the paper. The .md file will be `YYYY-MM-DD-[url_slug].md` and the permalink will be `https://[yourdomain]/publications/YYYY-MM-DD-[url_slug]`\n", - "\n", - "This is how the raw file looks (it doesn't look pretty, use a spreadsheet or other program to edit and create)." - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "pub_date\ttitle\tvenue\texcerpt\tcitation\turl_slug\tpaper_url\r\n", - "2009-10-01\tPaper Title Number 1\tJournal 1\tThis paper is about the number 1. The number 2 is left for future work.\tYour Name, You. (2009). \"Paper Title Number 1.\" Journal 1. 1(1).\tpaper-title-number-1\thttp://academicpages.github.io/files/paper1.pdf\r\n", - "2010-10-01\tPaper Title Number 2\tJournal 1\tThis paper is about the number 2. The number 3 is left for future work.\tYour Name, You. (2010). \"Paper Title Number 2.\" Journal 1. 1(2).\tpaper-title-number-2\thttp://academicpages.github.io/files/paper2.pdf\r\n", - "2015-10-01\tPaper Title Number 3\tJournal 1\tThis paper is about the number 3. The number 4 is left for future work.\tYour Name, You. (2015). \"Paper Title Number 3.\" Journal 1. 1(3).\tpaper-title-number-3\thttp://academicpages.github.io/files/paper3.pdf" - ] - } - ], - "source": [ - "!cat publications.tsv" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Import pandas\n", - "\n", - "We are using the very handy pandas library for dataframes." - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "collapsed": true, - "deletable": true, - "editable": true - }, - "outputs": [], - "source": [ - "import pandas as pd" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Import TSV\n", - "\n", - "Pandas makes this easy with the read_csv function. We are using a TSV, so we specify the separator as a tab, or `\\t`.\n", - "\n", - "I found it important to put this data in a tab-separated values format, because there are a lot of commas in this kind of data and comma-separated values can get messed up. However, you can modify the import statement, as pandas also has read_excel(), read_json(), and others." - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "collapsed": false, - "deletable": true, - "editable": true - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
pub_datetitlevenueexcerptcitationurl_slugpaper_url
02009-10-01Paper Title Number 1Journal 1This paper is about the number 1. The number 2...Your Name, You. (2009). \"Paper Title Number 1....paper-title-number-1http://academicpages.github.io/files/paper1.pdf
12010-10-01Paper Title Number 2Journal 1This paper is about the number 2. The number 3...Your Name, You. (2010). \"Paper Title Number 2....paper-title-number-2http://academicpages.github.io/files/paper2.pdf
22015-10-01Paper Title Number 3Journal 1This paper is about the number 3. The number 4...Your Name, You. (2015). \"Paper Title Number 3....paper-title-number-3http://academicpages.github.io/files/paper3.pdf
\n", - "
" - ], - "text/plain": [ - " pub_date title venue \\\n", - "0 2009-10-01 Paper Title Number 1 Journal 1 \n", - "1 2010-10-01 Paper Title Number 2 Journal 1 \n", - "2 2015-10-01 Paper Title Number 3 Journal 1 \n", - "\n", - " excerpt \\\n", - "0 This paper is about the number 1. The number 2... \n", - "1 This paper is about the number 2. The number 3... \n", - "2 This paper is about the number 3. The number 4... \n", - "\n", - " citation url_slug \\\n", - "0 Your Name, You. (2009). \"Paper Title Number 1.... paper-title-number-1 \n", - "1 Your Name, You. (2010). \"Paper Title Number 2.... paper-title-number-2 \n", - "2 Your Name, You. (2015). \"Paper Title Number 3.... paper-title-number-3 \n", - "\n", - " paper_url \n", - "0 http://academicpages.github.io/files/paper1.pdf \n", - "1 http://academicpages.github.io/files/paper2.pdf \n", - "2 http://academicpages.github.io/files/paper3.pdf " - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "publications = pd.read_csv(\"publications.tsv\", sep=\"\\t\", header=0)\n", - "publications\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Escape special characters\n", - "\n", - "YAML is very picky about how it takes a valid string, so we are replacing single and double quotes (and ampersands) with their HTML encoded equivilents. This makes them look not so readable in raw format, but they are parsed and rendered nicely." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "collapsed": true, - "deletable": true, - "editable": true - }, - "outputs": [], - "source": [ - "html_escape_table = {\n", - " \"&\": \"&\",\n", - " '\"': \""\",\n", - " \"'\": \"'\"\n", - " }\n", - "\n", - "def html_escape(text):\n", - " \"\"\"Produce entities within text.\"\"\"\n", - " return \"\".join(html_escape_table.get(c,c) for c in text)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Creating the markdown files\n", - "\n", - "This is where the heavy lifting is done. This loops through all the rows in the TSV dataframe, then starts to concatentate a big string (```md```) that contains the markdown for each type. It does the YAML metadata first, then does the description for the individual page." - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "collapsed": false, - "deletable": true, - "editable": true - }, - "outputs": [], - "source": [ - "import os\n", - "for row, item in publications.iterrows():\n", - " \n", - " md_filename = str(item.pub_date) + \"-\" + item.url_slug + \".md\"\n", - " html_filename = str(item.pub_date) + \"-\" + item.url_slug\n", - " year = item.pub_date[:4]\n", - " \n", - " ## YAML variables\n", - " \n", - " md = \"---\\ntitle: \\\"\" + item.title + '\"\\n'\n", - " \n", - " md += \"\"\"collection: publications\"\"\"\n", - " \n", - " md += \"\"\"\\npermalink: /publication/\"\"\" + html_filename\n", - " \n", - " if len(str(item.excerpt)) > 5:\n", - " md += \"\\nexcerpt: '\" + html_escape(item.excerpt) + \"'\"\n", - " \n", - " md += \"\\ndate: \" + str(item.pub_date) \n", - " \n", - " md += \"\\nvenue: '\" + html_escape(item.venue) + \"'\"\n", - " \n", - " if len(str(item.paper_url)) > 5:\n", - " md += \"\\npaperurl: '\" + item.paper_url + \"'\"\n", - " \n", - " md += \"\\ncitation: '\" + html_escape(item.citation) + \"'\"\n", - " \n", - " md += \"\\n---\"\n", - " \n", - " ## Markdown description for individual page\n", - " \n", - " if len(str(item.excerpt)) > 5:\n", - " md += \"\\n\" + html_escape(item.excerpt) + \"\\n\"\n", - " \n", - " if len(str(item.paper_url)) > 5:\n", - " md += \"\\n[Download paper here](\" + item.paper_url + \")\\n\" \n", - " \n", - " md += \"\\nRecommended citation: \" + item.citation\n", - " \n", - " md_filename = os.path.basename(md_filename)\n", - " \n", - " with open(\"../_publications/\" + md_filename, 'w') as f:\n", - " f.write(md)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "These files are in the publications directory, one directory below where we're working from." - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "collapsed": false, - "deletable": true, - "editable": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2009-10-01-paper-title-number-1.md 2015-10-01-paper-title-number-3.md\r\n", - "2010-10-01-paper-title-number-2.md\r\n" - ] - } - ], - "source": [ - "!ls ../_publications/" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "collapsed": false, - "deletable": true, - "editable": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "---\r\n", - "title: \"Paper Title Number 1\"\r\n", - "collection: publications\r\n", - "permalink: /publication/2009-10-01-paper-title-number-1\r\n", - "excerpt: 'This paper is about the number 1. The number 2 is left for future work.'\r\n", - "date: 2009-10-01\r\n", - "venue: 'Journal 1'\r\n", - "paperurl: 'http://academicpages.github.io/files/paper1.pdf'\r\n", - "citation: 'Your Name, You. (2009). "Paper Title Number 1." Journal 1. 1(1).'\r\n", - "---\r\n", - "This paper is about the number 1. The number 2 is left for future work.\r\n", - "\r\n", - "[Download paper here](http://academicpages.github.io/files/paper1.pdf)\r\n", - "\r\n", - "Recommended citation: Your Name, You. (2009). \"Paper Title Number 1.\" Journal 1. 1(1)." - ] - } - ], - "source": [ - "!cat ../_publications/2009-10-01-paper-title-number-1.md" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true, - "deletable": true, - "editable": true - }, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.1" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/markdown_generator/publications.py b/markdown_generator/publications.py deleted file mode 100644 index 2d0b102..0000000 --- a/markdown_generator/publications.py +++ /dev/null @@ -1,108 +0,0 @@ - -# coding: utf-8 - -# # Publications markdown generator for academicpages -# -# Takes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook, with the core python code in publications.py. Run either from the `markdown_generator` folder after replacing `publications.tsv` with one that fits your format. -# -# TODO: Make this work with BibTex and other databases of citations, rather than Stuart's non-standard TSV format and citation style. -# - -# ## Data format -# -# The TSV needs to have the following columns: pub_date, title, venue, excerpt, citation, site_url, and paper_url, with a header at the top. -# -# - `excerpt` and `paper_url` can be blank, but the others must have values. -# - `pub_date` must be formatted as YYYY-MM-DD. -# - `url_slug` will be the descriptive part of the .md file and the permalink URL for the page about the paper. The .md file will be `YYYY-MM-DD-[url_slug].md` and the permalink will be `https://[yourdomain]/publications/YYYY-MM-DD-[url_slug]` - - -# ## Import pandas -# -# We are using the very handy pandas library for dataframes. - -# In[2]: - -import pandas as pd - - -# ## Import TSV -# -# Pandas makes this easy with the read_csv function. We are using a TSV, so we specify the separator as a tab, or `\t`. -# -# I found it important to put this data in a tab-separated values format, because there are a lot of commas in this kind of data and comma-separated values can get messed up. However, you can modify the import statement, as pandas also has read_excel(), read_json(), and others. - -# In[3]: - -publications = pd.read_csv("publications.tsv", sep="\t", header=0) -publications - - -# ## Escape special characters -# -# YAML is very picky about how it takes a valid string, so we are replacing single and double quotes (and ampersands) with their HTML encoded equivilents. This makes them look not so readable in raw format, but they are parsed and rendered nicely. - -# In[4]: - -html_escape_table = { - "&": "&", - '"': """, - "'": "'" - } - -def html_escape(text): - """Produce entities within text.""" - return "".join(html_escape_table.get(c,c) for c in text) - - -# ## Creating the markdown files -# -# This is where the heavy lifting is done. This loops through all the rows in the TSV dataframe, then starts to concatentate a big string (```md```) that contains the markdown for each type. It does the YAML metadata first, then does the description for the individual page. If you don't want something to appear (like the "Recommended citation") - -# In[5]: - -import os -for row, item in publications.iterrows(): - - md_filename = str(item.pub_date) + "-" + item.url_slug + ".md" - html_filename = str(item.pub_date) + "-" + item.url_slug - year = item.pub_date[:4] - - ## YAML variables - - md = "---\ntitle: \"" + item.title + '"\n' - - md += """collection: publications""" - - md += """\npermalink: /publication/""" + html_filename - - if len(str(item.excerpt)) > 5: - md += "\nexcerpt: '" + html_escape(item.excerpt) + "'" - - md += "\ndate: " + str(item.pub_date) - - md += "\nvenue: '" + html_escape(item.venue) + "'" - - if len(str(item.paper_url)) > 5: - md += "\npaperurl: '" + item.paper_url + "'" - - md += "\ncitation: '" + html_escape(item.citation) + "'" - - md += "\n---" - - ## Markdown description for individual page - - if len(str(item.paper_url)) > 5: - md += "\n\nDownload paper here\n" - - if len(str(item.excerpt)) > 5: - md += "\n" + html_escape(item.excerpt) + "\n" - - md += "\nRecommended citation: " + item.citation - - md_filename = os.path.basename(md_filename) - - with open("../_publications/" + md_filename, 'w') as f: - f.write(md) - - diff --git a/markdown_generator/publications.tsv b/markdown_generator/publications.tsv deleted file mode 100644 index 49e7963..0000000 --- a/markdown_generator/publications.tsv +++ /dev/null @@ -1,4 +0,0 @@ -pub_date title venue excerpt citation url_slug paper_url -2009-10-01 Paper Title Number 1 Journal 1 This paper is about the number 1. The number 2 is left for future work. Your Name, You. (2009). "Paper Title Number 1." Journal 1. 1(1). paper-title-number-1 http://academicpages.github.io/files/paper1.pdf -2010-10-01 Paper Title Number 2 Journal 1 This paper is about the number 2. The number 3 is left for future work. Your Name, You. (2010). "Paper Title Number 2." Journal 1. 1(2). paper-title-number-2 http://academicpages.github.io/files/paper2.pdf -2015-10-01 Paper Title Number 3 Journal 1 This paper is about the number 3. The number 4 is left for future work. Your Name, You. (2015). "Paper Title Number 3." Journal 1. 1(3). paper-title-number-3 http://academicpages.github.io/files/paper3.pdf \ No newline at end of file diff --git a/markdown_generator/pubsFromBib.py b/markdown_generator/pubsFromBib.py deleted file mode 100644 index 92b4d02..0000000 --- a/markdown_generator/pubsFromBib.py +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env python -# coding: utf-8 - -# # Publications markdown generator for academicpages -# -# Takes a set of bibtex of publications and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_jupyter.html)). -# -# The core python code is also in `pubsFromBibs.py`. -# Run either from the `markdown_generator` folder after replacing updating the publist dictionary with: -# * bib file names -# * specific venue keys based on your bib file preferences -# * any specific pre-text for specific files -# * Collection Name (future feature) -# -# TODO: Make this work with other databases of citations, -# TODO: Merge this with the existing TSV parsing solution - - -from pybtex.database.input import bibtex -import pybtex.database.input.bibtex -from time import strptime -import string -import html -import os -import re - -#todo: incorporate different collection types rather than a catch all publications, requires other changes to template -publist = { - "proceeding": { - "file" : "proceedings.bib", - "venuekey": "booktitle", - "venue-pretext": "In the proceedings of ", - "collection" : {"name":"publications", - "permalink":"/publication/"} - - }, - "journal":{ - "file": "pubs.bib", - "venuekey" : "journal", - "venue-pretext" : "", - "collection" : {"name":"publications", - "permalink":"/publication/"} - } -} - -html_escape_table = { - "&": "&", - '"': """, - "'": "'" - } - -def html_escape(text): - """Produce entities within text.""" - return "".join(html_escape_table.get(c,c) for c in text) - - -for pubsource in publist: - parser = bibtex.Parser() - bibdata = parser.parse_file(publist[pubsource]["file"]) - - #loop through the individual references in a given bibtex file - for bib_id in bibdata.entries: - #reset default date - pub_year = "1900" - pub_month = "01" - pub_day = "01" - - b = bibdata.entries[bib_id].fields - - try: - pub_year = f'{b["year"]}' - - #todo: this hack for month and day needs some cleanup - if "month" in b.keys(): - if(len(b["month"])<3): - pub_month = "0"+b["month"] - pub_month = pub_month[-2:] - elif(b["month"] not in range(12)): - tmnth = strptime(b["month"][:3],'%b').tm_mon - pub_month = "{:02d}".format(tmnth) - else: - pub_month = str(b["month"]) - if "day" in b.keys(): - pub_day = str(b["day"]) - - - pub_date = pub_year+"-"+pub_month+"-"+pub_day - - #strip out {} as needed (some bibtex entries that maintain formatting) - clean_title = b["title"].replace("{", "").replace("}","").replace("\\","").replace(" ","-") - - url_slug = re.sub("\\[.*\\]|[^a-zA-Z0-9_-]", "", clean_title) - url_slug = url_slug.replace("--","-") - - md_filename = (str(pub_date) + "-" + url_slug + ".md").replace("--","-") - html_filename = (str(pub_date) + "-" + url_slug).replace("--","-") - - #Build Citation from text - citation = "" - - #citation authors - todo - add highlighting for primary author? - for author in bibdata.entries[bib_id].persons["author"]: - citation = citation+" "+author.first_names[0]+" "+author.last_names[0]+", " - - #citation title - citation = citation + "\"" + html_escape(b["title"].replace("{", "").replace("}","").replace("\\","")) + ".\"" - - #add venue logic depending on citation type - venue = publist[pubsource]["venue-pretext"]+b[publist[pubsource]["venuekey"]].replace("{", "").replace("}","").replace("\\","") - - citation = citation + " " + html_escape(venue) - citation = citation + ", " + pub_year + "." - - - ## YAML variables - md = "---\ntitle: \"" + html_escape(b["title"].replace("{", "").replace("}","").replace("\\","")) + '"\n' - - md += """collection: """ + publist[pubsource]["collection"]["name"] - - md += """\npermalink: """ + publist[pubsource]["collection"]["permalink"] + html_filename - - note = False - if "note" in b.keys(): - if len(str(b["note"])) > 5: - md += "\nexcerpt: '" + html_escape(b["note"]) + "'" - note = True - - md += "\ndate: " + str(pub_date) - - md += "\nvenue: '" + html_escape(venue) + "'" - - url = False - if "url" in b.keys(): - if len(str(b["url"])) > 5: - md += "\npaperurl: '" + b["url"] + "'" - url = True - - md += "\ncitation: '" + html_escape(citation) + "'" - - md += "\n---" - - - ## Markdown description for individual page - if note: - md += "\n" + html_escape(b["note"]) + "\n" - - if url: - md += "\n[Access paper here](" + b["url"] + "){:target=\"_blank\"}\n" - else: - md += "\nUse [Google Scholar](https://scholar.google.com/scholar?q="+html.escape(clean_title.replace("-","+"))+"){:target=\"_blank\"} for full citation" - - md_filename = os.path.basename(md_filename) - - with open("../_publications/" + md_filename, 'w') as f: - f.write(md) - print(f'SUCESSFULLY PARSED {bib_id}: \"', b["title"][:60],"..."*(len(b['title'])>60),"\"") - # field may not exist for a reference - except KeyError as e: - print(f'WARNING Missing Expected Field {e} from entry {bib_id}: \"', b["title"][:30],"..."*(len(b['title'])>30),"\"") - continue diff --git a/markdown_generator/readme.md b/markdown_generator/readme.md deleted file mode 100644 index 013aa73..0000000 --- a/markdown_generator/readme.md +++ /dev/null @@ -1,7 +0,0 @@ -# Jupyter notebook markdown generator - -These .ipynb files are Jupyter notebook files that convert a TSV containing structured data about talks (`talks.tsv`) or presentations (`presentations.tsv`) into individual markdown files that will be properly formatted for the academicpages template. The notebooks contain a lot of documentation about the process. The .py files are pure python that do the same things if they are executed in a terminal, they just don't have pretty documentation. - - - - diff --git a/markdown_generator/talks.ipynb b/markdown_generator/talks.ipynb deleted file mode 100644 index f7e2347..0000000 --- a/markdown_generator/talks.ipynb +++ /dev/null @@ -1,380 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "deletable": true, - "editable": true - }, - "source": [ - "# Talks markdown generator for academicpages\n", - "\n", - "Takes a TSV of talks with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_jupyter.html)). The core python code is also in `talks.py`. Run either from the `markdown_generator` folder after replacing `talks.tsv` with one containing your data.\n", - "\n", - "TODO: Make this work with BibTex and other databases, rather than Stuart's non-standard TSV format and citation style." - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "collapsed": false, - "deletable": true, - "editable": true - }, - "outputs": [], - "source": [ - "import pandas as pd\n", - "import os" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Data format\n", - "\n", - "The TSV needs to have the following columns: title, type, url_slug, venue, date, location, talk_url, description, with a header at the top. Many of these fields can be blank, but the columns must be in the TSV.\n", - "\n", - "- Fields that cannot be blank: `title`, `url_slug`, `date`. All else can be blank. `type` defaults to \"Talk\" \n", - "- `date` must be formatted as YYYY-MM-DD.\n", - "- `url_slug` will be the descriptive part of the .md file and the permalink URL for the page about the paper. \n", - " - The .md file will be `YYYY-MM-DD-[url_slug].md` and the permalink will be `https://[yourdomain]/talks/YYYY-MM-DD-[url_slug]`\n", - " - The combination of `url_slug` and `date` must be unique, as it will be the basis for your filenames\n", - "\n", - "This is how the raw file looks (it doesn't look pretty, use a spreadsheet or other program to edit and create)." - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "title\ttype\turl_slug\tvenue\tdate\tlocation\ttalk_url\tdescription\r\n", - "Talk 1 on Relevant Topic in Your Field\tTalk\ttalk-1\tUC San Francisco, Department of Testing\t2012-03-01\tSan Francisco, California\t\tThis is a description of your talk, which is a markdown files that can be all markdown-ified like any other post. Yay markdown!\r\n", - "Tutorial 1 on Relevant Topic in Your Field\tTutorial\ttutorial-1\tUC-Berkeley Institute for Testing Science\t2013-03-01\tBerkeley CA, USA\thttp://exampleurl.com\tThis is a description of your tutorial, note the different field in type. This is a markdown files that can be all markdown-ified like any other post. Yay markdown!\r\n", - "Talk 2 on Relevant Topic in Your Field\tTalk\ttalk-2\tLondon School of Testing\t2014-02-01\tLondon, UK\thttp://example2.com\tThis is a description of your talk, which is a markdown files that can be all markdown-ified like any other post. Yay markdown!\r\n", - "Conference Proceeding talk 3 on Relevant Topic in Your Field\tConference proceedings talk\ttalk-3\tTesting Institute of America 2014 Annual Conference\t2014-03-01\tLos Angeles, CA\t\tThis is a description of your conference proceedings talk, note the different field in type. You can put anything in this field." - ] - } - ], - "source": [ - "!cat talks.tsv" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Import TSV\n", - "\n", - "Pandas makes this easy with the read_csv function. We are using a TSV, so we specify the separator as a tab, or `\\t`.\n", - "\n", - "I found it important to put this data in a tab-separated values format, because there are a lot of commas in this kind of data and comma-separated values can get messed up. However, you can modify the import statement, as pandas also has read_excel(), read_json(), and others." - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "collapsed": false, - "deletable": true, - "editable": true - }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
titletypeurl_slugvenuedatelocationtalk_urldescription
0Talk 1 on Relevant Topic in Your FieldTalktalk-1UC San Francisco, Department of Testing2012-03-01San Francisco, CaliforniaNaNThis is a description of your talk, which is a...
1Tutorial 1 on Relevant Topic in Your FieldTutorialtutorial-1UC-Berkeley Institute for Testing Science2013-03-01Berkeley CA, USAhttp://exampleurl.comThis is a description of your tutorial, note t...
2Talk 2 on Relevant Topic in Your FieldTalktalk-2London School of Testing2014-02-01London, UKhttp://example2.comThis is a description of your talk, which is a...
3Conference Proceeding talk 3 on Relevant Topic...Conference proceedings talktalk-3Testing Institute of America 2014 Annual Confe...2014-03-01Los Angeles, CANaNThis is a description of your conference proce...
\n", - "
" - ], - "text/plain": [ - " title \\\n", - "0 Talk 1 on Relevant Topic in Your Field \n", - "1 Tutorial 1 on Relevant Topic in Your Field \n", - "2 Talk 2 on Relevant Topic in Your Field \n", - "3 Conference Proceeding talk 3 on Relevant Topic... \n", - "\n", - " type url_slug \\\n", - "0 Talk talk-1 \n", - "1 Tutorial tutorial-1 \n", - "2 Talk talk-2 \n", - "3 Conference proceedings talk talk-3 \n", - "\n", - " venue date \\\n", - "0 UC San Francisco, Department of Testing 2012-03-01 \n", - "1 UC-Berkeley Institute for Testing Science 2013-03-01 \n", - "2 London School of Testing 2014-02-01 \n", - "3 Testing Institute of America 2014 Annual Confe... 2014-03-01 \n", - "\n", - " location talk_url \\\n", - "0 San Francisco, California NaN \n", - "1 Berkeley CA, USA http://exampleurl.com \n", - "2 London, UK http://example2.com \n", - "3 Los Angeles, CA NaN \n", - "\n", - " description \n", - "0 This is a description of your talk, which is a... \n", - "1 This is a description of your tutorial, note t... \n", - "2 This is a description of your talk, which is a... \n", - "3 This is a description of your conference proce... " - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "talks = pd.read_csv(\"talks.tsv\", sep=\"\\t\", header=0)\n", - "talks" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Escape special characters\n", - "\n", - "YAML is very picky about how it takes a valid string, so we are replacing single and double quotes (and ampersands) with their HTML encoded equivilents. This makes them look not so readable in raw format, but they are parsed and rendered nicely." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "collapsed": false, - "deletable": true, - "editable": true - }, - "outputs": [], - "source": [ - "html_escape_table = {\n", - " \"&\": \"&\",\n", - " '\"': \""\",\n", - " \"'\": \"'\"\n", - " }\n", - "\n", - "def html_escape(text):\n", - " if type(text) is str:\n", - " return \"\".join(html_escape_table.get(c,c) for c in text)\n", - " else:\n", - " return \"False\"" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Creating the markdown files\n", - "\n", - "This is where the heavy lifting is done. This loops through all the rows in the TSV dataframe, then starts to concatentate a big string (```md```) that contains the markdown for each type. It does the YAML metadata first, then does the description for the individual page." - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "collapsed": false, - "deletable": true, - "editable": true - }, - "outputs": [], - "source": [ - "loc_dict = {}\n", - "\n", - "for row, item in talks.iterrows():\n", - " \n", - " md_filename = str(item.date) + \"-\" + item.url_slug + \".md\"\n", - " html_filename = str(item.date) + \"-\" + item.url_slug \n", - " year = item.date[:4]\n", - " \n", - " md = \"---\\ntitle: \\\"\" + item.title + '\"\\n'\n", - " md += \"collection: talks\" + \"\\n\"\n", - " \n", - " if len(str(item.type)) > 3:\n", - " md += 'type: \"' + item.type + '\"\\n'\n", - " else:\n", - " md += 'type: \"Talk\"\\n'\n", - " \n", - " md += \"permalink: /talks/\" + html_filename + \"\\n\"\n", - " \n", - " if len(str(item.venue)) > 3:\n", - " md += 'venue: \"' + item.venue + '\"\\n'\n", - " \n", - " if len(str(item.location)) > 3:\n", - " md += \"date: \" + str(item.date) + \"\\n\"\n", - " \n", - " if len(str(item.location)) > 3:\n", - " md += 'location: \"' + str(item.location) + '\"\\n'\n", - " \n", - " md += \"---\\n\"\n", - " \n", - " \n", - " if len(str(item.talk_url)) > 3:\n", - " md += \"\\n[More information here](\" + item.talk_url + \")\\n\" \n", - " \n", - " \n", - " if len(str(item.description)) > 3:\n", - " md += \"\\n\" + html_escape(item.description) + \"\\n\"\n", - " \n", - " \n", - " md_filename = os.path.basename(md_filename)\n", - " #print(md)\n", - " \n", - " with open(\"../_talks/\" + md_filename, 'w') as f:\n", - " f.write(md)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "These files are in the talks directory, one directory below where we're working from." - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "collapsed": false, - "deletable": true, - "editable": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2012-03-01-talk-1.md\t 2014-02-01-talk-2.md\r\n", - "2013-03-01-tutorial-1.md 2014-03-01-talk-3.md\r\n" - ] - } - ], - "source": [ - "!ls ../_talks" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "collapsed": false, - "deletable": true, - "editable": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "---\r\n", - "title: \"Tutorial 1 on Relevant Topic in Your Field\"\r\n", - "collection: talks\r\n", - "type: \"Tutorial\"\r\n", - "permalink: /talks/2013-03-01-tutorial-1\r\n", - "venue: \"UC-Berkeley Institute for Testing Science\"\r\n", - "date: 2013-03-01\r\n", - "location: \"Berkeley CA, USA\"\r\n", - "---\r\n", - "\r\n", - "[More information here](http://exampleurl.com)\r\n", - "\r\n", - "This is a description of your tutorial, note the different field in type. This is a markdown files that can be all markdown-ified like any other post. Yay markdown!\r\n" - ] - } - ], - "source": [ - "!cat ../_talks/2013-03-01-tutorial-1.md" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.1" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/markdown_generator/talks.py b/markdown_generator/talks.py deleted file mode 100644 index 818fd28..0000000 --- a/markdown_generator/talks.py +++ /dev/null @@ -1,111 +0,0 @@ - -# coding: utf-8 - -# # Talks markdown generator for academicpages -# -# Takes a TSV of talks with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_jupyter.html)). The core python code is also in `talks.py`. Run either from the `markdown_generator` folder after replacing `talks.tsv` with one containing your data. -# -# TODO: Make this work with BibTex and other databases, rather than Stuart's non-standard TSV format and citation style. - -# In[1]: - -import pandas as pd -import os - - -# ## Data format -# -# The TSV needs to have the following columns: title, type, url_slug, venue, date, location, talk_url, description, with a header at the top. Many of these fields can be blank, but the columns must be in the TSV. -# -# - Fields that cannot be blank: `title`, `url_slug`, `date`. All else can be blank. `type` defaults to "Talk" -# - `date` must be formatted as YYYY-MM-DD. -# - `url_slug` will be the descriptive part of the .md file and the permalink URL for the page about the paper. -# - The .md file will be `YYYY-MM-DD-[url_slug].md` and the permalink will be `https://[yourdomain]/talks/YYYY-MM-DD-[url_slug]` -# - The combination of `url_slug` and `date` must be unique, as it will be the basis for your filenames -# - - -# ## Import TSV -# -# Pandas makes this easy with the read_csv function. We are using a TSV, so we specify the separator as a tab, or `\t`. -# -# I found it important to put this data in a tab-separated values format, because there are a lot of commas in this kind of data and comma-separated values can get messed up. However, you can modify the import statement, as pandas also has read_excel(), read_json(), and others. - -# In[3]: - -talks = pd.read_csv("talks.tsv", sep="\t", header=0) -talks - - -# ## Escape special characters -# -# YAML is very picky about how it takes a valid string, so we are replacing single and double quotes (and ampersands) with their HTML encoded equivilents. This makes them look not so readable in raw format, but they are parsed and rendered nicely. - -# In[4]: - -html_escape_table = { - "&": "&", - '"': """, - "'": "'" - } - -def html_escape(text): - if type(text) is str: - return "".join(html_escape_table.get(c,c) for c in text) - else: - return "False" - - -# ## Creating the markdown files -# -# This is where the heavy lifting is done. This loops through all the rows in the TSV dataframe, then starts to concatentate a big string (```md```) that contains the markdown for each type. It does the YAML metadata first, then does the description for the individual page. - -# In[5]: - -loc_dict = {} - -for row, item in talks.iterrows(): - - md_filename = str(item.date) + "-" + item.url_slug + ".md" - html_filename = str(item.date) + "-" + item.url_slug - year = item.date[:4] - - md = "---\ntitle: \"" + item.title + '"\n' - md += "collection: talks" + "\n" - - if len(str(item.type)) > 3: - md += 'type: "' + item.type + '"\n' - else: - md += 'type: "Talk"\n' - - md += "permalink: /talks/" + html_filename + "\n" - - if len(str(item.venue)) > 3: - md += 'venue: "' + item.venue + '"\n' - - if len(str(item.location)) > 3: - md += "date: " + str(item.date) + "\n" - - if len(str(item.location)) > 3: - md += 'location: "' + str(item.location) + '"\n' - - md += "---\n" - - - if len(str(item.talk_url)) > 3: - md += "\n[More information here](" + item.talk_url + ")\n" - - - if len(str(item.description)) > 3: - md += "\n" + html_escape(item.description) + "\n" - - - md_filename = os.path.basename(md_filename) - #print(md) - - with open("../_talks/" + md_filename, 'w') as f: - f.write(md) - - -# These files are in the talks directory, one directory below where we're working from. - diff --git a/markdown_generator/talks.tsv b/markdown_generator/talks.tsv deleted file mode 100644 index 4e4b0d2..0000000 --- a/markdown_generator/talks.tsv +++ /dev/null @@ -1,5 +0,0 @@ -title type url_slug venue date location talk_url description -Talk 1 on Relevant Topic in Your Field Talk talk-1 UC San Francisco, Department of Testing 2012-03-01 San Francisco, California This is a description of your talk, which is a markdown files that can be all markdown-ified like any other post. Yay markdown! -Tutorial 1 on Relevant Topic in Your Field Tutorial tutorial-1 UC-Berkeley Institute for Testing Science 2013-03-01 Berkeley CA, USA http://exampleurl.com This is a description of your tutorial, note the different field in type. This is a markdown files that can be all markdown-ified like any other post. Yay markdown! -Talk 2 on Relevant Topic in Your Field Talk talk-2 London School of Testing 2014-02-01 London, UK http://example2.com This is a description of your talk, which is a markdown files that can be all markdown-ified like any other post. Yay markdown! -Conference Proceeding talk 3 on Relevant Topic in Your Field Conference proceedings talk talk-3 Testing Institute of America 2014 Annual Conference 2014-03-01 Los Angeles, CA This is a description of your conference proceedings talk, note the different field in type. You can put anything in this field. \ No newline at end of file