All Projects → lorenzwalthert → stylermd

lorenzwalthert / stylermd

Licence: other
Make markdown or plain text fit 80 characters. Or any limit you want.

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to stylermd

postcode
A PHP library to validate and format postcodes
Stars: ✭ 61 (+177.27%)
Mutual labels:  formatting
international-telephone-input
Integration to Magento 2 a jQuery plugin for entering and validating international telephone numbers.
Stars: ✭ 26 (+18.18%)
Mutual labels:  formatting
Textylic
A note taking app developed for the 22nd century
Stars: ✭ 34 (+54.55%)
Mutual labels:  formatting
sublime-postcss-sorting
Sublime Text plugin to sort CSS rules content with specified order.
Stars: ✭ 19 (-13.64%)
Mutual labels:  formatting
prettysize-rs
Pretty-print file sizes and more
Stars: ✭ 29 (+31.82%)
Mutual labels:  formatting
fantomas-for-vs
Visual Studio Formatter for F#
Stars: ✭ 43 (+95.45%)
Mutual labels:  formatting
idea-uroborosql-formatter
Beautiful SQL Formatter for IntelliJ Platform
Stars: ✭ 18 (-18.18%)
Mutual labels:  formatting
dbt-formatter
Formatting for dbt jinja-flavored sql
Stars: ✭ 37 (+68.18%)
Mutual labels:  formatting
clang-format-action
GitHub Action for clang-format checking
Stars: ✭ 48 (+118.18%)
Mutual labels:  formatting
Golite
Add essential language support for the Go language to Sublime Text 3.
Stars: ✭ 14 (-36.36%)
Mutual labels:  formatting
jsonfiddle
JSON Fiddling
Stars: ✭ 14 (-36.36%)
Mutual labels:  formatting
sf
Simple Bash framework which provides argument parsing, usage output and text formatting variables
Stars: ✭ 16 (-27.27%)
Mutual labels:  formatting
laravel-formatters
«‎Formatter» pattern for Laravel
Stars: ✭ 86 (+290.91%)
Mutual labels:  formatting
scalafmt-probot
🤖Github bot for checking code formatting with scalafmt
Stars: ✭ 15 (-31.82%)
Mutual labels:  formatting
gspread-formatting
Complete cell formatting support for Google spreadsheets via gspread package.
Stars: ✭ 121 (+450%)
Mutual labels:  formatting
slackdown
A simple Slack message text formatting to HTML code converter.
Stars: ✭ 27 (+22.73%)
Mutual labels:  formatting
biguint-format
Node.js module to format big uint numbers from a byte array or a Buffer
Stars: ✭ 16 (-27.27%)
Mutual labels:  formatting
awesome-kramdown
A collection of awesome kramdown goodies for the converter for (structured) text with formatting markup in markdown conventions
Stars: ✭ 36 (+63.64%)
Mutual labels:  formatting
guidelines
Guidelines, patterns, and coding styles
Stars: ✭ 16 (-27.27%)
Mutual labels:  formatting
ronin-support
A support library for Ronin. Like activesupport, but for hacking!
Stars: ✭ 23 (+4.55%)
Mutual labels:  formatting

Style your markdown

lifecycle Travis build status AppVeyor build status

Just keep up one rule: 80 characters per line. I promise it will take 80% of your time. – Lorenz Walthert

The main motivation for creating this package was because when working with bookdown / blogdown or Rmarkdown in general, I spent way too much time just keeping up the 80 character width rule as every word you add or remove in a paragraph affects all subsequent lines.

Functionality

This package is similar to styler, but it styles non-code elements and files and it does really just one thing: Making every line at most 80 characters, or a custom line width you can set with the option stylermd.line_width, i.e. options(stylermd.line_width = 60). It supports:

  • Both adding and removing line breaks for float text, nested enumerations and bullet lists.
  • Files with and without code chunks (any extension).
  • Ignoring code chunks and latex equations.
  • Files with YAML Header.
  • Preserves paragraphs.

You can install it from GitHub:

remotes::install_github("lorenzwalthert/stylermd")

API

You can use:

  • tidy_text().
  • tidy_file().
  • the RStudio Addins (restarting RStudio after installation). One styles the highlighted text, the other styles the active file, remembering the cursor position. Set the environment variable save_after_styling to TRUE, for example in your .Rprofile to enable saving after styling. Hint: Assign a keyboard short-cut for the Addin with Menu -> Tools -> Modify Keyboard Shortcuts for most productive use.

Example

library(magrittr)
text <- "1. introduced above. We do this by first creating a style guide with the designated wrapper function `create_style_guide()`. It takes transformer"
stylermd::tidy_text(text) %>%
  cat(sep = "\n")
1. introduced above. We do this by first creating a style guide with the
   designated wrapper function `create_style_guide()`. It takes transformer
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].