New Plugin: Markdown #61

Merged
merged 13 commits into from Aug 26, 2012

Projects

None yet

2 participants

@codebrainz
Geany member

See the README file for details.

The build system needs some attention, especially Waf, which hasn't been modified for this plugin yet.

codebrainz added some commits Jul 15, 2012
@codebrainz codebrainz markdown: Initial commit
No Waf build system yet.
1109430
@codebrainz codebrainz markdown: Add acknowledgement of Discount to README.md
To comply with the conditions of the Discount license.
189cc3f
@codebrainz codebrainz markdown: Improve Alternate template
Includes fonts, background image and external stylesheet.
36400f5
@codebrainz codebrainz markdown: Use document's encoding for preview 283d76a
@codebrainz codebrainz markdown: Re-write preferences and templates
Massive changes, including:
* Uses a single template specified in the conf file or by GUI.
* Allows setting the font, code font, their sizes and the FG/BG colors
  for the WebKit view.
* Make a GObject MarkdownConfig to manage the config and prefs GUI.
* Delete all old templates stuff.
c620c79
@codebrainz codebrainz markdown: Fix trailing whitespace issues 9be5443
@codebrainz codebrainz markdown: Improve documentation
* Add rst README file
* Add some useful screenshots
* Add a generated HTML help file
* Use the plugin_help() feature to load the HTML help file
* Update build system to install help files
9fb81fc
@codebrainz codebrainz markdown: Clarify license with regards to embedded Discount code 5c6c4d7
@codebrainz codebrainz markdown: Remove pointless module with one function 07b29d0
@codebrainz codebrainz markdown: Add code to Discount to return the internal buffer
This avoids the caller having to duplicate the internal string and
works for the simple case of the Markdown plugin.

Adds function `mkd_compile_document()` which simply compiles a const
string to a newly-allocated string, hiding the little bit of extra
code needed normally to do this.

There's tons of noise in the commit because I had trailing whitespace
stripping enabled and I re-indented some of the code to make it more
readable (to me).
9e68cc2
@codebrainz codebrainz markdown: Massive refactoring
* Make MarkdownViewer a GObject, and a subclass of WebKitWebView
* A MarkdownViewer "has a" MarkdownConfig property
* Optimize (somewhat) string handling/duplication also using changes
  to Discount code.
* Main plugin code manages the scrolled window holding the
  MarkdownViewer and monitors the MarkdownViewer's MarkdownConfig
  for property changes to know when to move the scrolled window
  between the sidebar and message window notebooks.
* Various other cleanups and changes
bc9b590
@codebrainz codebrainz markdown: Update patch that shows changes made to Discount code
Mostly noisy but still makes it easier to see the changes made.
2ddd10f
@codebrainz codebrainz markdown: Fix possible crasher
Always ensure that the viewer's internal GString buffer is created
just to be safe. Also ensure the viewer is always updated which will
make sure the internal buffer is always created anyway.
ce22ed9
@codebrainz
Geany member

Actually, I think I'm going to make this plugin more generic and not just for Markdown. I'll close the request for now.

@codebrainz codebrainz closed this Jul 17, 2012
@codebrainz codebrainz reopened this Aug 18, 2012
@codebrainz
Geany member

OK, I tried to make a more generic plugin but it seems there's not any C/C++ markup->html generators/libraries for other markup languages. For reStructuredText, I tried to use the Python C API to access some docutils functions but it was far too slow to be used in the main thread like this. I do not wish to make all kind of complications of running separate threads or processes and all that, so I'm going to leave this plugin as just Markdown supporting. Maybe in the future I'll try to make a more generic plugin, probably just running of external commands/scripts in separate processes, so to not block the UI while converting to HTML.

@frlan frlan merged commit ca0c77f into geany:master Aug 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment