From 28eff57a6941488a6c4e291f4a3af9f59b1493e5 Mon Sep 17 00:00:00 2001 From: Ben Bader Date: Sun, 16 Feb 2014 15:57:54 -0800 Subject: [PATCH] Replacing "#" with "@" as the directive-start character. In the excitement of getting something working and polished, I overlooked the fact that "#" is indeed part of Markdown syntax, and that there is little to distinguish `;; #Directive` from `;; # Title`. "@" is visually distinctive, and is not currently part of Markdown. --- src/marginalia/parser.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/marginalia/parser.clj b/src/marginalia/parser.clj index 21c1e97..709d5ae 100644 --- a/src/marginalia/parser.clj +++ b/src/marginalia/parser.clj @@ -50,14 +50,14 @@ (def directives "Marginalia can be given directives in comments. A directive is a comment - line containing a directive name, in the form `;; #DirectiveName`. + line containing a directive name, in the form `;; @DirectiveName`. Directives change the behavior of the parser within the files that contain them. The following directives are defined: - * `#MargDisable` suppresses subsequent comments from the docs - * `#MargEnable` includes subsequent comments in the docs" + * `@MargDisable` suppresses subsequent comments from the docs + * `@MargEnable` includes subsequent comments in the docs" {"MargDisable" (fn [] (swap! *comments-enabled* (constantly false))) "MargEnable" (fn [] (swap! *comments-enabled* (constantly true)))}) @@ -66,7 +66,7 @@ indicating whether the line should be included in the comments list." [line] - (let [directive (->> (re-find #"^;+\s*#(\w+)" line) + (let [directive (->> (re-find #"^;+\s*@(\w+)" line) (last) (get directives))] (when directive