Git Product home page Git Product logo

martek's Introduction

martek (v0.0)

Render markdown to latex.

martek's People

Contributors

iceplant avatar unquietcode avatar

Watchers

 avatar  avatar

martek's Issues

header spacing

padding underneath headers

First heading

then some text

second heading

some more text

second

spaced text

third

oof

V2 release

  • pypy, if needed
  • dockerhub, if needed
  • githuib actions setup so it can be shared
  • repository made public
  • README updated

support for comments

Support comments in the generated markdown. See the example issues.py in the root of the repository for a starting point. The comments can be rendered in a new section after the end of the issue description.

Maybe something like....

@UnquietCode wrote on January 4th, 2021:

Comments are cool.

And

multiline
comments t00

  • titles are good
  • body is good
  • spacing is good

script and/or action to backfill issues

Script which can backfill issues for the action. Possibly it fires when installed to the repository, or maybe it can just be run once to establish the branch and the issue backlog. Users should probably be allowed to decide whether to backfill or not so doing it automatically maybe isn't the way to go.

Since the actions can be run from the 'Actions' menu in GitHub it probably makes sense to create a new action that does the backfilling, configured to run against only open, only closed, or both open and closed issues.

replace all unicode characters with escaped versions

if there is unicode in the markdown, it should end up in the latex output

  • (try something like these: Β« Β» )
  • emojis and other weird unicode characters don't cause errors
  • emojis render correctly?
  • resolve font-related compiler errors

πŸ˜€πŸ˜πŸ₯ΆπŸ€“πŸ˜°πŸ˜ˆπŸ’©

switch to alpine for the base docker image

We would like to reduce the hulking 1.8GB ubuntu-based image down to something more manageable, if possible. For this Alpine linux would be the preferred route to take.

include issue number and issue title in generated markdown

In addition to the issue description, generate markdown for the issue number and title. Use an n-dash ( – ) rather than a hyphen.

Example markdown:

# #6 – Issue Title
Issue Description

which renders as:

#⁠6 – Issue Title

Issue description...

combine the custom renderer and pandoc into a docker container

Use the pandoc docker container and add in this codebase to produce a docker image which can render a single PDF from a single markdown file.

ROCKY EDIT:

  • image 1 wraps xelatex binary as entrypoint
  • image 2 martek image that inherits from 1, takes in contents as file or standard input and runs martek on it
  • image 3 = take in github info, and run the script in image 2

Block Code Fixes

  • long lines wrap to new line
  • unicode characters render correctly
  • Code blocks handle page breaks well
  • No latex code appears in code blocks

Latex Formatting in pdf

  • Lists can render in multiple levels like in the markdown
  • There are newlines between milestones and text
  • There are newlines between different paragraphs of description
  • Comments are separated and headered appropriately
  • image rendering has been tested extensively
  • Links work correctly
  • File references work correctly
  • 'new content' doesn't appear above each comment? => This will be handled in milestone 2
  • spacing is consistent
  • '\' doesn't render a newline when used in a comment
  • backslashes render correctly when used in comment text

Here | is some inline}}}!!!||| code

Burning Man is an event held annually since 1986 in the western United States.[1] Since 1991, the event has been located at Black Rock City, a temporary city erected in the Black Rock Desert of northwestern Nevada. The event is held approximately 100 miles (160 km) north-northeast of Reno. As outlined by Burning Man co-founder Larry Harvey in 2004, the event is guided by these ten principles: radical inclusion, gifting, decommodification, radical self-reliance, radical self-expression, communal effort, civic responsibility, leaving no trace, participation, and immediacy.[2] The event derives its name from its culmination, the symbolic burning of a large wooden effigy, referred to as "The Man," that occurs on the Saturday evening before Labor Day.[3]

Black Rock City is located in USA WestBlack Rock CityBlack Rock City
Location in the western United States
The event originated on June 22, 1986, on Baker Beach in San Francisco as a small function organized by Larry Harvey and Jerry James, the builders of the first "Man" effigy. It has since been held annually, spanning the nine days leading up to and including Labor Day. Over the event's history, attendance has steadily increased. In 2019, 78,850 people participated in the event.[4]

Black Rock City is located in NevadaBlack Rock CityBlack Rock City
Location in Nevada
NPR said about Burning Man, "Once considered an underground gathering for bohemians and free spirits of all stripes, Burning Man has since evolved into a destination for social media influencers, celebrities and the Silicon Valley elite."[5] At Burning Man, the participants are supposed to design and build all the art, activities, and events.[6] Artwork at Burning Man includes experimental and interactive sculptures, buildings, performances and art cars, among other media. These contributions are inspired by a theme that is chosen annually by the Burning Man Project.[7] An anonymous attendee once elaborated that "Burning Man is about 'why not' overwhelming 'why'".[8] Participation is a key precept for the community,[9] so there is much controversy in the community over the problem of non-participatory influencers and elite at the event.[10][11]

Burning Man is organized by the Burning Man Project, a non-profit organization that, in 2013, succeeded Black Rock City LLC, a for-profit limited liability company. Black Rock City LLC was formed in 1999 to represent the event's organizers, and is now considered a subsidiary of the non-profit organization. The Burning Man Project endorses multiple smaller regional events guided by the Burning Man principles, both in the United States and internationally. The organization provides the essential infrastructure of Black Rock City and works year-round to bring Burning Man culture to the world through programs such as Burners Without Borders,[12] Black Rock Solar,[13] and Global Arts Grants.[14]

make a set of tests

Make a set of tests that prove things work.

  • JSON files that emulate github API responses
  • images of what we think they should look like

support custom token "BracketedSpan"

Support a new span token "BracketedSpan". Which looks like: [text]{metadata}

  • implement a new token class
  • pass token to our renderer on init
  • define a new render method render_bracketedspan (or maybe render_bracketed_span) which will be invoked by mistletoe
  • for now render it in latex by just rendering the text part, ignoring the metadata
  • test that it renders

Support Multilevel Lists

  • Lists only render in one level right now.

Try:

  • one
    • two
    • three
      • five
  • FOUR
  1. A numbered list
    1. A nested numbered list
    2. Which is numbered
  2. Which is numbered

support emoji

At least support unicode emoji black and white characters. Can then try to use a library of colorful ones.

Empty list causes an error

The code doesn't put any items in the list, and latex can't handle a list with no \item s.

For example

Or

Version 1 cleanup

  • milestone handling when missing
  • make inline code block less dark
  • there is an extra space around the text in inline code
  • text isn't selectable in inline code? due to underlines?

  • @user
  • hrule spacing around
  • image folder needs to end up with .tex outputs
  • title should be #685 - Title
  • # isn't being escaped in title
  • try to put vpsace on their own line in the .tex
  • extra vspace being added at at top of document
  • change headings to use font size rather than section? Or otherwise investigate spacing issues
  • avoid changing the fonts, just use default

  • try to use textt instead of codeFont
  • remove /headerType
  • try to use sections without changes to font size (at least for the first levels, try to support 4 for now)
  • sections usually give their own line break, don't need to add one
  • line endings are coming out as single slash, not double
  • make sure "__", "--", "**" works with inline code
  • space around - in title
  • newline after milestone version
  • paragraphs breaks aren't good (see latex #13)
  • links get underline treatment
  • confirm images and links works (Ben can clean up render pipeline?)
  • make code wrap around so it doesn't go outside box (see 8)
  • unicode characters can render
  • code doesn't break on unicode character it doesn't recognize
  • test on rasputin repo
  • scale images to page (see rasputin #76)
  • get rasputin #73 image to render
  • list items are too far apart
  • move .tex files out of images
  • add new line after milestone
  • eliminate dead code
  • make code indentation consistent
  • milestone isn't indented
  • recent inline link break is fixed => links just don't work in preview mode. Auto links haven't been implemented yet (Ben will do this)
  • list
  • list
  • list
    • indent
    • indent
  • list
  • list

I'm an inline-style link

issue_20.pdf
bman-image

Some text


three consecutive underscores

three consecutive dashes


three consecutive asterisks

And here is some code:
    code
    code
    code
    ÿƁỲ◒

__inline**code**__-- ()*#^!&#^%&()^$#(*&%)(*^!#&%^!)$(*^&__)@#\\\\\\\\\\\\\\\
bman-image

write script to pull github issues for a repo and render them into PDF's

Use the example issues.py script in the root of the repository. Pass the repository in as a command line argument, pass the token in via an environment variable (instead of the json file)..

  • pull open issues for a repository
  • generate markdown content (in-memory), combining custom markdown with the existing GitHub issue content, which is in markdown
  • pass to our renderer to generate .tex, write it out to a file
  • invoke pandoc on the file to generate a PDF

include issue labels in the generated markdown

Include the label information, if any. Just add a line under the title and before the description. Use the BracketedSpan created in #3 to pass information to the latex renderer. We want to pass the color information, which comes from the label JSON.

In the renderer use this information to draw a filled in colored box around the text, similar to GitHub. Bonus points if they can be rounded. We also need to decide if the text color should be white or black given the label color. See this comment for a simple formula for deciding: https://stackoverflow.com/a/3943023

For an issue with two labels, something like:

# #6 – Issue Title
[Feature]{color="#1A2B3C"} [Important]{color="#1B2C3D"}

Issue Description

which renders as:

#⁠6 – Issue Title

ft it

Issue description...

  • Label text renders
  • Has color
  • maps color correctly
  • is round
  • spacing is good
  • can handle multiple labels

integrate docker container into a github action that can run on a repo

Create a GitHub action utilizing the docker container than can run whenever an issue is created or updated. The action should take the payload and render it to a PDF which is then placed somewhere, such as in the task itself or in the repository as a file, etc. Try to use this repo as the source for the action, but if necessary make a new repo just for the action. A new dockerfile can inherit from this one to add in the action logic.

Probably for now the best bet would be to make a new branch in the repository that has its own root, and it can contain the issue markdown as well as the PDF.

  • new action configuration
  • new docker file inheriting from the normal one
  • script to take branch (configured in action) and generate issues in a path (also configured)
  • action fires on issue create/update
  • files committed to branch when done

support checkboxes in the generated latex

Detect GFM checkboxes in the ordered and unordered lists, and replace them with better markup.
Currently they are styled as:

# empty boxes
$\\square$
   
# checked boxes
$\\boxtimes$

include milestone in generated markdown

Include the milestone information, if any. Just add a line under the title and before the description.

Something like:

# #6 – Issue Title
**Milestone**: Cool Milestone Bro
Issue Description

which renders as:

#⁠6 – Issue Title

Milestone: Cool Milestone Bro

Issue description...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.