Skip to content
/ dedent Public

Convert indentation to a flat file format (like pyx)

Notifications You must be signed in to change notification settings

za3k/dedent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

'dedent' is a small script to convert hierarchical, indented files into something which can easily be sent into standard unix tools.  The program 'indent' performs the reverse transformation
'dedent' is written in Python 3

Caveats:
    - The output includes trailing whitespace.  Make sure not to trim it.
    - Escape sequences are not honored, and 'dedent' pays no particular attention to common string sequences.

Sample input and output can be seen by running dedent on any of the files in the included example folder.

Animals
    Birds
        Hummingbird
    Mammals
        Dog
Trees
    Oak
    Elm

gives the output (Where underscores represent spaces for readability):

=Animals
>____
=Birds
>____
=Hummingbird
<____
=Mammals
>____
=Dog
<____
<____
=Trees
>____
=Oak
=Elm
<____

About

Convert indentation to a flat file format (like pyx)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages