Giter Site home page Giter Site logo

sean0x42 / markdown-extract Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 5.0 72 KB

Extract sections of a markdown file. Useful for automatically extracting changelogs

Home Page: https://hub.docker.com/r/sean0x42/markdown-extract

License: MIT License

Rust 87.35% Dockerfile 12.65%
cli markdown rust

markdown-extract's Introduction

๐ŸŒ

markdown-extract's People

Contributors

axelrindle avatar sean0x42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

markdown-extract's Issues

Reduce size of Docker image using alpine or busybox

Currently the completed docker image weights in at around 70mb. It's possible to reduce this using Alpine Linux of busybox instead of debian, bringing the total size down to around 10mb.

The issue is that compilation is more challenging, so more experimentation will be required.

Github Action

This would be an awesome Github Action to generate release changelogs.

Automatically release notes

This would be a super useful feature, with the following benefits:

  • No longer need the Rust/Cargo installed
  • GitHub Actions minutes can be saved since less time is spent compiling.

I know there is an action for this somewhere, and we can use a build matrix to achieve cross platform compilation.

Exit with 1 if there are no matches

The tool exits with an error code of 0 and prints No matches. when there are no matches which makes it unnecessarily difficult to determine whether the extraction worked. IMO it should return an error code != 0 by default but introducing a new CLI flag would work as well.

Action doesn't work

The github action passes the filename in as a second argument, but then fails with:

error: Found argument './pr_body' which wasn't expected, or isn't valid in this context

USAGE:
    markdown-extract <pattern> <path> --no-print-matched-heading

For more information try --help
validate test plan

...assuming the filename is "./pr_body" I get the same failure without the leading ./, as well as with an absolute path.

After doing a little bit of research, the workspace in an action is mounted in the container under /github/workspace. So, it'd be nice if either the docs mentioned to prefix files with /github/workspace, or if the action Dockerfile set the workdir to /github/workspace and the docs said to use relative paths.

Or, probably ideally, maybe the binary detects that it's running as an action and does the path translation. Relative path = prefix /github/workspace, absolute path = substitue env $GITHUB_WORKDIR for /github/workspace or alert that the file must be located there if it's not. It's possible to use a different entrypoint in the action metadata. You can specify analternate entrypoint in the action.yml, so this logic could be encapsulated into a shell script which does the arg manipulation and then passes them along to the real program. It could even handle a /github/workspace prefix specially and leave that alone for backwards compatibility.

Provide as Docker image

Hey @sean0x42, thanks for the tool. ๐Ÿ‘ Would like to integrate it into our CI pipeline but don't wanna setup a whole Rust/cargo installation. Are you willing to publish markdown-extract as a Docker image? I'm happy to help if you need any support.

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.