Skip to content

SmallStep-Foundation/Markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmallMarkdown

A Markdown editor and viewer for GNUstep on Linux, implemented in Objective-C using only GPL/LGPL-compatible C and Objective-C libraries.

Features

  • Phase 1 — Core: NSDocument-based file handling, NSTextView editor, basic preferences (NSUserDefaults).
  • Phase 2 — Markdown: Integration with libmarkdown (Discount) to convert Markdown to HTML.
  • Phase 3 — Preview: Split view with editor and preview pane; HTML preview (full rendering via WebKitGTK when built).
  • Phase 4 — Syntax highlighting: Custom NSTextStorage with NSRegularExpression for headings, bold/italic, code blocks, links, lists.
  • Phase 5 — Spell checking: GNU Aspell integration for the editor.
  • Phase 6 — Preferences: Font selection, theme (light/dark), preview refresh behavior.

Allowed libraries

Purpose Library License Notes
Markdown parsing Discount (libmarkdown) BSD GPL-compatible use
HTML preview WebKitGTK LGPL Optional; full HTML
Spell checking Aspell LGPL Optional
ODT export libzip BSD GPL-compatible
Syntax highlighting Custom Obj-C Your choice In-tree

Build (GNUstep on Linux)

Prerequisites

  • GNUstep Make (gnustep-make)
  • GNUstep Base and GUI (gnustep-base, gnustep-gui)
  • Optional: libmarkdown (Discount) for Markdown→HTML
  • Optional: Aspell for spell checking
  • Optional: WebKitGTK for HTML preview (see below)
  • libzip for ODT export (e.g. libzip-dev on Debian/Ubuntu; build uses pkg-config --libs libzip)

Compile

. /usr/share/GNUstep/Makefiles/GNUstep.sh   # or your installation path
make

Enable libmarkdown (Discount)

Install the library (package name may be libmarkdown2-dev or build from Discount). Then in GNUmakefile uncomment:

SmallMarkdown_OBJCFLAGS += -DHAVE_MKDIO_H
SmallMarkdown_LDFLAGS += -lmarkdown

(Use -ldiscount if your system provides libdiscount.)

Enable Aspell

Install Aspell and development files, then in GNUmakefile uncomment:

SmallMarkdown_OBJCFLAGS += -DHAVE_ASPELL
SmallMarkdown_LDFLAGS += -laspell

WebKitGTK preview (Phase 3)

The preview pane currently shows HTML as text. For full HTML rendering:

  1. Install WebKitGTK development packages (e.g. libwebkit2gtk-4.1-dev).
  2. Implement an NSView that embeds a WebKitWebView (e.g. via X11 window embedding or a separate GTK widget).
  3. Uncomment the WebKitGTK lines in GNUmakefile and link your view.

Embedding WebKitGTK in a GNUstep window typically requires passing the X11 window ID from the NSWindow to a GTK socket/plug or similar; the app is structured so this can be added without changing the rest of the code.

Run

./SmallMarkdown.app/SmallMarkdown

Or open from the GNUstep menu. You can create new documents or open .md / .markdown files.

Testing

Implementation status vs plan: see PLAN_REVIEW.md.

Unit tests

Build and run from the project root (after sourcing GNUstep.sh):

make -C Tests
./Tests/obj/SmallMarkdownUnitTests

Or run both unit and UI tests:

make test

Unit tests cover: MarkdownRenderer (render/wrap, empty/nil input), MarkdownTextStorage (replace, attributes), SMDocument (content, dataOfType, readFromData), SMSpellChecker (enable/suggest/check).

UI tests

Verify document window structure (split view, editor, preview):

make -C Tests
./Tests/obj/SmallMarkdownUITests

On a headless machine use a virtual display, e.g. xvfb-run ./Tests/obj/SmallMarkdownUITests.

Project layout

  • Main.m, SMAppDelegate — application entry and preferences registration.
  • SMDocument, SMWindowController — document and window; editor and split view built in code.
  • MarkdownRenderer — Markdown→HTML via libmarkdown (Discount).
  • SMPreviewView — preview pane (HTML text or WebKitGTK when available).
  • MarkdownTextStorage — syntax highlighting in the editor.
  • SMSpellChecker — Aspell integration.
  • SMPreferencesController — font, theme, preview refresh, spell check options.

License

This project is under the GNU Affero General Public License v3 or later. See LICENSE.

Libraries used (Discount, Aspell, WebKitGTK) have their own licenses (BSD, LGPL, etc.) and are GPL/LGPL-compatible.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors