Code Monkey home page Code Monkey logo

mdslw's Issues

The path to 1.0

Before a 1.0 release that comes with some stability guarantees, some things should be taken care of. This is issue collects all such tasks.

  • #16: handle features in a more sustainable way
  • #15: support hierarchical configuration files
  • #17: simplify supporting new extensions

Provide more details about diff

In case a file differs from the desired state, it could be useful to provide more information about the deviation. That way, mdslw could possibly even serve as a linter that could be hooked into a general purpose language server such as efm-langserver. The similar crate could be used to compute a diff. Since such a computation can be costly, it should only be done if explicitly requested.

Make supporting new extensions easy

Many Some markdown extensions appear to work the following way:

  • There is a single line that has a specific indentation, prefix character, or may simply contain text.
  • The next line also has a specific indentation or a prefix character, but both values are different than for the previous line.
  • At the same indentation level, arbitrary markdown content may follow. Not all extensions require indentation here, but requiring the same indentation level makes detection a lot easier and, thus, is likely a requirement that should be added.
  • After an optional empty line, a line like the second one and everything following it may repeat.

In the example of definition lists, the first line is simply unindented text while the second line may have some indentation and has a colon as a prefix character.

Such extensions could be supported by adding a generic struct that contains all that logic. It basically detects the markdown covered by the extension and extracts the basic markdown contained within. Then, that extracted markdown, with a reduced maximum line width due to the indentation, can be formatted in the usual way.

Definition lists

Currently, definition lists get mangled by mdslw.
I realize, that there are a lot of markdown extensions out there, but I could not find an explicit statement about scope in the README.md (CommonMark?).

Is this a bug or a feature :) ?

Convert `--features` into something more permanent

At the moment, the --features flag serves as a bit of a dumping ground for new functionality that may or may not be useful. Those --features that are unused or not useful should be removed while those --features that are use and useful should be converted into something more permanent. They could be converted into their own command line flags, for example.

If you are a user of mdslw and find specific features useful, please comment on this issue, naming those useful --features. At the moment, more or less all --features are up for removal.

mdslw not ignoring frontmatter

Hello,
it seems that mdslw formats frontmatter as well in some cases. An example:

---
item1: hello
item2:
- my
- list
---

mdslw should not change this, but when run, it yields:

---
item1:
hello item2:
- my
- list
---

Support configuration files

It would be desirable to support something similar to a .prettierrc file, maybe calling it mdslw.yaml, that can be used to configure mdslw in a hierarchical way. That is, each such file influences how mdslw behaves for all files below it in the file tree. If there are two config files above a markdown file, then the closer one will overwrite options in the one farther away. The precedence of config files lies above that of default values and below that of environment variables.

It would be useful if clap supported such layered/hierarchical config files, but it does not at the moment, cf. this discussion.

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.