Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WYSIWYG editor #1

Open
chripo opened this issue Mar 13, 2013 · 5 comments
Open

WYSIWYG editor #1

chripo opened this issue Mar 13, 2013 · 5 comments
Milestone

Comments

@chripo
Copy link
Collaborator

chripo commented Mar 13, 2013

add WYSIWYG features

  • [http://dillinger.io/]
  • [http://markable.in/editor/]
  • [http://oscargodson.github.com/EpicEditor/]
  • [https://github.com/derobins/wmd]
  • [http://fguillen.github.com/MDMagick/]

editing should work without js too.

@posativ
Copy link

posativ commented Mar 13, 2013

I'm all for the ACE editor (includes reST highlighting for example). The WYG part can be done using the compiler backend (slow but should performe better for incremental compilers ;-)?

edit: it does not include reST by default, but it can use TextMate syntax highlighting bundles.

@chripo
Copy link
Collaborator Author

chripo commented Mar 13, 2013

nice.
i thought about a to way preview,

  • the primary on client side in side by side view to validate syntax
  • and a real compiled preview under domain.tld/knecht/foo/preview

@posativ
Copy link

posativ commented Mar 13, 2013

Another point against a JS live preview: Markdown extensions, engine specific, non-standard extensions (at least for Pelican, Nikola and Acrylamid) that will either not render or cause syntax errors.

I guess one can circumvent the markdown extension issue by using an editor that provides "MultiMarkdown" but there might be still certain edge cases that are differently handled. But on the other hand, full re-compilation is not a realtime preview, hence I suggest to offer a get_preview(path) API that has a fallback to recompilation/JS but can be overridden to ask the engine to only compile the provided filename and return the HTML (without updating the output files).

@chripo
Copy link
Collaborator Author

chripo commented Mar 13, 2013

hence I suggest to offer a
get_preview(path) API that has a fallback to recompilation/JS but
can be overridden to ask the engine to only compile the provided
filename and return the HTML (without updating the output files).

good point ;)
the stub already exists
678b799#L0R54
shall i file an issue?


Reply to this email directly or view it on GitHub:
#1 (comment)

@posativ
Copy link

posativ commented Mar 13, 2013

Not sure whether I can provide a API directly in Acrylamid but I have already done this for a small utility I use to convert a post to HTML and then back to real plain text (for Language Tool):

from functools import partial
from acrylamid import core, readers, filters

env = Environment({'options': type('X', (), {'ignore': False})})
conf = core.load("conf.py")

def _render(conf, env, filepath):
    filters.initialize([], conf, env)
    post = readers.Entry(sys.argv[1], conf)

    html = post.source
    for item in post.filters + conf.filters:
        split = item.split('+')

        if split[0].startswith('no'):
            continue

        fx = filters.get_filters()[split[0]](conf, env, split[0])
        html = fx.transform(html, post, *split[1:])

    return html

render = partial(conf, env)

Not sure if I'll include this into Acrylamid directly as the actual rendering is always delayed but I'm willing to maintain the preview(self, file_path=None) implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants