-
-
Notifications
You must be signed in to change notification settings - Fork 551
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmark-format: Initial work on a formatting tool.
The only implemented feature is reindenting to arbitrary width, but that was also the actually complicated one so there's that.
- Loading branch information
1 parent
a44cfaf
commit 014b781
Showing
5 changed files
with
540 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import sys | ||
import argparse | ||
|
||
HERE = "@CMAKE_CURRENT_SOURCE_DIR@" | ||
sys.path.append(HERE) | ||
sys.path.append(os.path.join(HERE, os.pardir, 'wrappers')) | ||
|
||
from remarkor import * | ||
from wrapper import conf | ||
|
||
conf.set_library_path("@CMAKE_CURRENT_BINARY_DIR@") | ||
|
||
if __name__=='__main__': | ||
arg_parser = argparse.ArgumentParser() | ||
arg_parser.add_argument('input') | ||
arg_parser.add_argument('--width', type=int, default=80) | ||
args = arg_parser.parse_args() | ||
|
||
remarkor = Remarkor.from_filename(args.input) | ||
res = remarkor.remark(width=args.width) | ||
sys.stdout.write(res) |
Oops, something went wrong.