GithubHelp home page GithubHelp logo

shollingsworth / freeplane_tools Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 226 KB

This package provides tooling around translating freeplane mindmap files into other useful formats

License: MIT License

Makefile 4.28% Python 94.56% Dockerfile 0.34% Shell 0.81%
mindmaps markdown python cli freeplane

freeplane_tools's Introduction

github-issues github-languages-code-size github-stars github-forks

pypi-v pypi-status pypi-l pypi-dm pypi-pyversions pypi-implementation

TOC

Freeplane Tools

If you hate writing Markdown, but love mindmaps (and using freeplane this toolset is for you.

These python programs aim to ease translating a mindmap into various markdown formats.

This document README.md was made with mm2github.py with  README.mm as a source.

Enjoy!

Pull requests welcome. :)

Installation

To install this package from pypy run the following command.


pip3 install freeplane_tools

License

See: LICENSE

Quickstart

Run the following if you want a quick demo of how this works. Have freeplane installed before running this.


pip3 install freeplane_tools

mm2template.py mymindmap.mm

freeplane mymindmap.mm

# do your editing in freeplane

mm2github.py -w mymindmap.mm


This will create: mymindmap.md

Example

Just want to look?

This mindmap produces the following markdown

CLI Commands

mm2bitbucket_server.py

usage: mm2bitbucket_server.py [-h] [-w] [-o OUTFILE] mindmap_file

Convert a Freeplane Mindmap to Bitbucket Markdown.

positional arguments:
  mindmap_file          mindmap_file help

optional arguments:
  -h, --help            show this help message and exit
  -w, --write           write markdown file
  -o OUTFILE, --outfile OUTFILE


mm2github.py

usage: mm2github.py [-h] [-w] [-o OUTFILE] mindmap_file

Convert a Freeplane Mindmap to Github Markdown.

positional arguments:
  mindmap_file          mindmap_file help

optional arguments:
  -h, --help            show this help message and exit
  -w, --write           write markdown file
  -o OUTFILE, --outfile OUTFILE


mm2template.py

usage: mm2template.py [-h] dest_file

Copy a Mindmap Template to destination file.

positional arguments:
  dest_file   destination file

optional arguments:
  -h, --help  show this help message and exit


Building

os / Package prerequisites:


pip3 install twine pydoctor

  • Install Locally from current branch
    • make install_local
  • Build Package
    • make pkg
  • Release
    • make documentation
      • Make sure git tree is clean
    • make bump_release
    • make release

Other Docs

freeplane_tools's People

Contributors

shollingsworth avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

freeplane_tools's Issues

parser error when node text has format

Error

mm2github.py -w -o /dev/stdout ~/t.mm 
Saving file to: /dev/stdout
Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniforge/base/bin/mm2github.py", line 48, in <module>
    main(args)
  File "/opt/homebrew/Caskroom/miniforge/base/bin/mm2github.py", line 38, in main
    mm.write_document(outfile)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/freeplane_tools/base.py", line 159, in write_document
    fileh.write(self.get_document())
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/freeplane_tools/github.py", line 46, in get_document
    self._toc(),
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/freeplane_tools/base.py", line 135, in _toc
    return "\n".join(n.toc_entry for n in self._iternodes() if n.toc_entry)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/freeplane_tools/base.py", line 135, in <genexpr>
    return "\n".join(n.toc_entry for n in self._iternodes() if n.toc_entry)
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/freeplane_tools/base.py", line 107, in toc_entry
    return f"{pad}[{self.text}](#{self._toc_name})"
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/freeplane_tools/github.py", line 15, in _toc_name
    return re.sub("[^a-zA-Z0-9]", "-", self.text).lower() + "-"
  File "/opt/homebrew/Caskroom/miniforge/base/lib/python3.9/re.py", line 210, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object

node content

<node ID="ID_1521234531" CREATED="1632342121801" MODIFIED="1637123461801"><richcontent TYPE="NODE">

<html>
  <head>
    
  </head>
  <body>
    <p>
      test text
    </p>
  </body>
</html>
</richcontent>
</node>

Question: get parent of a node

Hello,
Thank you for your software! I try to write something like a mm2ics.py. I Use mindmap as a hierarchical todo list. And want to create a calendar with tasks out of it. Later I will try to two-way-sync between icalendar and mm-file.

Is there a way to get the parent of a node (or 'None')? My working example just uses mm.iternodes() so I lose the hierarchy. I think to use xml for that.

If it works in the future, are you interested in a pull-request?

Thanks
Ekran

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.