ShaishavGandhi / Partition
Licence: apache-2.0
A small library for generating markdown tables
Stars: ✭ 28
Programming Languages
kotlin
9241 projects
Labels
Projects that are alternatives of or similar to Partition
Blog Content
Different articles related to software and/or electronics hacking - Published at http://gbraad.nl/blog/
Stars: ✭ 7 (-75%)
Mutual labels: markdown
Markdownviewerplusplus
A Notepad++ Plugin to view a Markdown file rendered on-the-fly
Stars: ✭ 865 (+2989.29%)
Mutual labels: markdown
Codimd
CodiMD - Realtime collaborative markdown notes on all platforms.
Stars: ✭ 7,592 (+27014.29%)
Mutual labels: markdown
Remark Defsplit
plugin to change links and images to references with separate definitions
Stars: ✭ 7 (-75%)
Mutual labels: markdown
Notes
📝 Simple delightful note taking, with more unix and less lock-in.
Stars: ✭ 939 (+3253.57%)
Mutual labels: markdown
Trackdown
TrackDown - Issue Tracking with plain Markdown. If you are missing the "git clone" for your tickets from github.com or bitbucket.org, then this is for you. A lightweight Ticketing System for distributed and unconnected small Teams.
Stars: ✭ 10 (-64.29%)
Mutual labels: markdown
Markdownshare
The code behind https://markdownshare.com/
Stars: ✭ 15 (-46.43%)
Mutual labels: markdown
Remark Reference Links
plugin to transform links and images into references and definitions
Stars: ✭ 8 (-71.43%)
Mutual labels: markdown
Showoff
Don't just present; interact with your audience!
Stars: ✭ 879 (+3039.29%)
Mutual labels: markdown
Wp2md
Convert WordPress Posts to markdown files. / 将WordPress文章转换为md文件。
Stars: ✭ 8 (-71.43%)
Mutual labels: markdown
Markdowntableprettify Vscodeext
Visual Studio Code extension to prettify markdown tables.
Stars: ✭ 27 (-3.57%)
Mutual labels: markdown
Markdown Guide
The comprehensive Markdown reference guide.
Stars: ✭ 835 (+2882.14%)
Mutual labels: markdown
Markdown
A super fast, highly extensible markdown parser for PHP
Stars: ✭ 945 (+3275%)
Mutual labels: markdown
Tbls
tbls is a CI-Friendly tool for document a database, written in Go.
Stars: ✭ 940 (+3257.14%)
Mutual labels: markdown
Symphony
🎶 一款用 Java 实现的现代化社区(论坛/问答/BBS/社交网络/博客)系统平台。A modern community (forum/Q&A/BBS/SNS/blog) system platform implemented in Java. https://ld246.com
Stars: ✭ 883 (+3053.57%)
Mutual labels: markdown
Partition
A small library for generating markdown tables. Inspired by picnic
Usage
Here's a simple example with Builder APIs
val table = TableBuilder()
.header("Command", "Description")
.row("git status", "List all new or modified files")
.row("git diff", "Show file differences that haven't been staged")
.build()
println(table.toString())
that would emit | Command | Description | | -- | -- | | git status | List all new or modified files | | git diff | Show file differences that haven't been staged |
DSL
For a more Kotlin-esque API, you can use DSL-like syntax
val table = table {
header("Command", "Description")
row("git status", "List all new or modified files")
row("git diff", "Show file differences that haven't been staged")
}
Cell Alignment
Partition supports cell alignment by specifying it in your table header
val table = table {
header(
cell {
value = "Command"
alignment = Alignment.START
},
cell {
value = "Description"
alignment = Alignment.CENTER
},
cell {
value = "Alias"
alignment = Alignment.END
}
)
row("git status", "List all new or modified files", "s")
row("git diff", "Show file differences that haven't been staged", "d")
}
which yields
Command | Description | Alias |
---|---|---|
git status | List all new or modified files | s |
git diff | Show file differences that haven't been staged | d |
Regular Markdown
Of course, you can also just use regular markdown in your Cell values as well.
val table = table {
header(
cell {
value = "Command"
alignment = Alignment.START
},
cell {
value = "Description"
alignment = Alignment.CENTER
},
cell {
value = "Alias"
alignment = Alignment.END
}
)
row("_git status_", "List all new or modified files", "s")
row("_git diff_", "Show file differences that haven't been staged", "d")
}
which yields (notice the italics for the commands)
Command | Description | Alias |
---|---|---|
git status | List all new or modified files | s |
git diff | Show file differences that haven't been staged | d |
Features
- Explicit table headers
- Cell alignment
- Different markdown providers (upcoming)
Download
implementation 'com.shaishavgandhi.partition:partition:x.y.z'
License
Copyright 2020 Shaishav Gandhi.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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].