ncornette / python-markdown-editor Goto Github PK
View Code? Open in Web Editor NEWStandalone editor for your markdown files
Standalone editor for your markdown files
./markdown_edit.py README.md
Traceback (most recent call last):
File "./markdown_edit.py", line 385, in
main()
File "./markdown_edit.py", line 375, in main
markdown_processor = markdown.Markdown(**options)
TypeError: init() got an unexpected keyword argument 'term_edit'
if it helps, python 2.6.6 on a 64b RH derivative
First, i say it's a very nice little python code and when we compare it to haroopad and its never ending list of dependencies it's nice to have something light.
Installing with pip the installation goes fine, but when launching the editor from command line it throws the following error:
ModuleNotFoundError: No module named 'pymdownx.extrarawhtml'
Uninstalling pymdown-extensions
and reinstalling a previous version e.g. pymdown-extensions==7.0
solved the issue for me. This happens because the requirement for installation is pymdown-extensions>=2.0
but can quickly be fixed by specifying exact version.
```
foo
```
Renders the following error:
File "markdowneditor/lib/python3.12/site-packages/pygments/__init__.py", line 82, in highlight
return format(lex(code, lexer), formatter, outfile)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "markdowneditor/lib/python3.12/site-packages/pygments/__init__.py", line 64, in format
formatter.format(tokens, realoutfile)
File "markdowneditor/lib/python3.12/site-packages/pygments/formatter.py", line 124, in format
return self.format_unencoded(tokensource, outfile)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "markdowneditor/lib/python3.12/site-packages/pygments/formatters/html.py", line 979, in format_unencoded
source = self.wrap(source)
^^^^^^^^^^^^^^^^^
TypeError: BlockHtmlFormatter.wrap() missing 1 required positional argument: 'outfile'
127.0.0.1 - - [12/Jul/2024 09:41:07] "POST /ajax/preview HTTP/1.1" 500 753
A workaround is to downgrade Pygments
to version 2.11.2 which seems to be the last compatible version.
pip install Pygments==2.11.2
Seems related to pygments/pygments#2101
after pressing save (and waiting) the vim-mode checkbox is unchecked and the preview is in the normal mode
Awesome project!
How would I make use of markdown extensions?
Directly after installing it
Version 5.0 (released Aug 18) of pymdown-extensions deprecates the github extension.
This generates the following stacktrace when I run markdown_editor README.md
:
Traceback (most recent call last): │Icon-32.png Info.plist error.html images modals
File "/Users/chb/.pyenv/versions/3.7.0/envs/mrkdwn/lib/python3.7/site-packages/markdown/__init__.py", line 231, in build_extension │Icon-48.png Settings.plist format.txt injection.js overview
module = importlib.import_module(ext_name) │Icon-64.png circle.png global.html intro.html sessions-export.zip
File "/Users/chb/.pyenv/versions/3.7.0/lib/python3.7/importlib/__init__.py", line 127, in import_module │[chb-mbp-sierra:Sessions.safariextension chb]$ grep export *
return _bootstrap._gcd_import(name[level:], package, level) │global.js: // which used to differ from the export format.
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import │global.js: // This version and above are identical to the export format as described in format.txt.
File "<frozen importlib._bootstrap>", line 983, in _find_and_load │global.js:var exportSessions = (function () {
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked │global.js: '\t<!-- NOTICE: This format is deprecated as an export and import option for Sessions. -->',
ModuleNotFoundError: No module named 'pymdownx.github' │global.js: return function (exportFormat, sessionIDs, failCallback, completeCallback) {
│global.js: format[exportFormat](sessionIDs);
During handling of the above exception, another exception occurred:
...
markdown
then tries a few other variations on module naming conventions before giving up.
I edited markdown_editor/editor.py
such that the pymdown-extension tuple included a different extension (arithmatex
in lieu of github
). But given that the user has the option of naming their own with -x
, maybe not include any by default?
Just installed with pip
pip install markdown-editor
Everything went ok, but neither markdown-edit or markdown-editor command works
Where is it installed?
How can i run it?
$ ./markdown_edit.py
Traceback (most recent call last):
File "./markdown_edit.py", line 13, in
import markdown
ImportError: No module named markdown
doing
yum install python-markdown
makes that error go away but I have no idea it that is necessary or sufficient.
for example, I also see a python-markdown2 package available
I have tried to type this in shell
$ markdown_edit README.md
It gave me
markdown_edit: command not found
not working with the simple command like in documentation:
Launch editor without input file for testing :
$ markdown_edit
I need to go to the folder where is install and run it, that shows the web editor: http://localhost:8222/
... site-packages/markdown_editor/web_edit.py
see the install I used:
[mythcat@desk ~]$ pip install markdown-editor
...
[mythcat@desk ~]$ markdown_edit
bash: markdown_edit: command not found
Right now the server is initiated to point to a particular file. It would be nice if one could open or save another file in the same folder directly from the browser.
Is this something there is any interest in pursuing?
I would like to use this project as a sort of personal wiki that I can connect through via ssh tunneling without having to kill/restart the server every time I want to edit a new file.
Hi,
I just tested the most recent master branch (downloaded as zip). When press save or preview button I always got the Error message
Traceback (most recent call last):
File "D:\Program Files\WinPython-64bit-2.7.10.2\Python-Markdown-Editor-master\markdown_editor\editor.py", line 145, in do_POST
content, keep_running = action_handler(self.server.app.document)
File "D:\Program Files\WinPython-64bit-2.7.10.2\Python-Markdown-Editor-master\markdown_editor\editor.py", line 286, in action_save
result = document.get_html_page()
File "D:\Program Files\WinPython-64bit-2.7.10.2\Python-Markdown-Editor-master\markdown_editor\editor.py", line 232, in get_html_page
""".format(self.inline_css, self.get_html())
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 2936: ordinal not in range(128)
Continue editing
My environment is Windows 10, Chrome Version 50.0.2661.102 m, WinPython-64bit-2.7.
Thanks!
It is currently really easily possible to access the website from a device which is not the server, however this is logged but not disabled by default and I guess it's not implemented yet.
More a pain point than a show-stopper, the editor piece doesn't account for any kind of word-wrapping.
I'm trying to make the following markdown code work properly:
**NOTES:**
1. one
2. two
```
code line 1
```
text
```
code line 2
code line 3
```
3. three
For some strange reason code line 2
and code line 3
are joined without any line break like this:
code line 2 code line 3
instead of showing 2 separate lines. On github and dillinger it works properly though.
Setup is the following:
After installing requirements with pip3 install --user -r requirements.txt
I still get ModuleNotFoundError: No module named 'mdx_pymdownx'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.