Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

markdown: Remove pointless module with one function

  • Loading branch information...
commit 07b29d084f2bbc6f65e24ec6a4306d47e904d98d 1 parent 5c6c4d7
Matthew Brush authored
2  markdown/src/Makefile.am
View
@@ -6,13 +6,11 @@ geanyplugins_LTLIBRARIES = markdown.la
markdown_la_SOURCES = \
conf.c \
- md.c \
plugin.c \
viewer.c
noinst_HEADERS = \
conf.h \
- md.h \
viewer.h
markdown_la_CFLAGS = \
46 markdown/src/md.c
View
@@ -1,46 +0,0 @@
-/*
- * md.c - Part of the Geany Markdown plugin
- *
- * Copyright 2012 Matthew Brush <mbrush@codebrainz.ca>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-
-#include <string.h>
-#include <stdio.h>
-#include "markdown.h"
-#include "md.h"
-
-gchar *markdown_to_html(const gchar *md_text)
-{
- Document *md;
- gchar *result = NULL;
-
- if (!md_text)
- return g_strdup("");
-
- md = mkd_string(md_text, strlen(md_text), 0);
- if (md) {
- if (mkd_compile(md, 0)) {
- gchar *res = NULL;
- mkd_document(md, &res);
- result = g_strdup(res);
- }
- mkd_cleanup(md);
- }
-
- return result;
-}
33 markdown/src/md.h
View
@@ -1,33 +0,0 @@
-/*
- * md.h - Part of the Geany Markdown plugin
- *
- * Copyright 2012 Matthew Brush <mbrush@codebrainz.ca>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-
-#ifndef MARKDOWN_MD_H
-#define MARKDOWN_MD_H
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-gchar *markdown_to_html(const gchar *md_text);
-
-G_END_DECLS
-
-#endif /* MARKDOWN_MD_H */
26 markdown/src/viewer.c
View
@@ -19,11 +19,13 @@
* MA 02110-1301, USA.
*/
-#include <geanyplugin.h>
+#include <string.h>
+#include <stdio.h>
#include <gtk/gtk.h>
#include <webkit/webkitwebview.h>
+#include <geanyplugin.h>
+#include "markdown.h"
#include "viewer.h"
-#include "md.h"
#include "conf.h"
#define MARKDOWN_VIEWER_TAB_LABEL _("Markdown Preview")
@@ -97,7 +99,27 @@ void on_viewer_load_status_notify(GObject *obj, GParamSpec *pspec, MarkdownViewe
}
}
+static gchar *
+markdown_to_html(const gchar *md_text)
+{
+ Document *md;
+ gchar *result = NULL;
+
+ if (!md_text)
+ return g_strdup("");
+
+ md = mkd_string(md_text, strlen(md_text), 0);
+ if (md) {
+ if (mkd_compile(md, 0)) {
+ gchar *res = NULL;
+ mkd_document(md, &res);
+ result = g_strdup(res);
+ }
+ mkd_cleanup(md);
+ }
+ return result;
+}
static gchar *
str_replace(const gchar *haystack, const gchar *needle, const gchar *repl)
Please sign in to comment.
Something went wrong with that request. Please try again.