Skip to content

Extending markdown preview #822

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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Extending markdown preview #822

wants to merge 18 commits into from

Conversation

aliraeini
Copy link

With only few lines of code modification, I am now using the Mardown geany plugin as a svg image viewer (adding any other file that a Webkit supports is possible too, I only added .svg and .html). This is really handy for me; I can now write my code, run them and plot the outpouts without leaving geany IDE :-). Any interest in merging these with the upsteram branch?

A side note: I have also changed the (internal) name of Tree Browser, the previous one kept appearing after Scope plugin tabs which was not ideal

Copy link
Member

@codebrainz codebrainz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't review the code in-depth since there are so many simple things wrong.

It seems to me it might be better to use the WebHelper plugin or develop a new plugin for real-time editing of other formats. I could possibly be persuaded otherwise though.

@@ -122,7 +122,7 @@ PLUGIN_VERSION_CHECK(224)
PLUGIN_SET_TRANSLATABLE_INFO(
LOCALEDIR,
GETTEXT_PACKAGE,
_("TreeBrowser"),
_("FileTreeBrowser"),// affects the alphabetical sorting in sidebar, puts TreeBrowser just after "Documents"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated to the pull request.

@@ -383,7 +389,8 @@ markdown_viewer_update_view(MarkdownViewer *self)
* substituting the file's basename for `index.html`. */
if (DOC_VALID(doc) && doc->real_path != NULL) {
gchar *base_dir = g_path_get_dirname(doc->real_path);
base_path = g_build_filename(base_dir, "index.html", NULL);
//base_path = g_build_filename(base_dir, "index.html", NULL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to comment out-lines, the old code can be found in Git history.

html = g_malloc(strlen(self->priv->text->str) + 1);
strcpy(html, self->priv->text->str); html[strlen(self->priv->text->str)]='\0';
}
else
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird code formatting and indentation and stuff. Please follow the same style and formatting as the other code.

@@ -166,12 +166,24 @@ update_markdown_viewer(MarkdownViewer *viewer)
{
GeanyDocument *doc = document_get_current();

if (DOC_VALID(doc) && g_strcmp0(doc->file_type->name, "Markdown") == 0) {
if (DOC_VALID(doc) && g_strcmp0(doc->file_type->name, "Markdown") == 0)
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why move the brace down?

}
}
else
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird formatting and indentation. Please follow the style and formatting of the other code.

@@ -43,7 +43,7 @@ PLUGIN_SET_TRANSLATABLE_INFO(LOCALEDIR, GETTEXT_PACKAGE,
# define MARKDOWN_HELP_FILE MARKDOWN_DOC_DIR "/html/help.html"
#endif

#define MARKDOWN_PREVIEW_LABEL _("Markdown Preview")
#define MARKDOWN_PREVIEW_LABEL _("Markdown")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't have anything to do with the pull request.

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

Successfully merging this pull request may close these issues.

3 participants