Permalink
Browse files

Convert docs

  • Loading branch information...
1 parent 0f8895c commit 9ad5bf07cabd4f6eec49c52f2b24583180756e9d Christian Johansen committed Feb 5, 2012
View
@@ -0,0 +1,3 @@
+[submodule "vendor/hijs"]
+ path = vendor/hijs
+ url = https://github.com/cloudhead/hijs.git
View
@@ -16,28 +16,35 @@
(point))))
;; <%= anchor "createOption" %>
-(defun replace-anchor-macro ()
- (interactive)
- (if (not (goto-next-anchor))
- (message "No more anchors")
- (let ((target (anchor-target))
- (text (anchor-text)))
+(defun replace-macro (type)
+ (if (not (goto-next-macro type))
+ (message (concat "No more " type "s"))
+ (let ((target (curr-target))
+ (text (curr-text)))
(insert (concat "<a href=\"#" target "\">" text "</a>"))
(while (not (looking-at "%>"))
(delete-char 1))
(delete-char 2))))
-(defun goto-next-anchor ()
+(defun replace-anchor-macro ()
+ (interactive)
+ (replace-macro "anchor"))
+
+(defun replace-module-macro ()
(interactive)
- (if (search-forward "<%= anchor" nil t)
- (progn (backward-char 10) (point)) nil))
+ (replace-macro "m"))
+
+(defun goto-next-macro (type)
+ (interactive)
+ (if (search-forward (concat "<%= " type) nil t)
+ (progn (backward-char (+ (length type) 4)) (point)) nil))
(defun jump-to-before-next (str)
(progn (search-forward str)
(backward-char)
(point)))
-(defun anchor-target ()
+(defun curr-target ()
(save-excursion
(let* ((beg (point))
(bound (search-forward "%>")))
@@ -51,7 +58,7 @@
(point)
(jump-to-before-next "\""))))))
-(defun anchor-text ()
+(defun curr-text ()
(save-excursion
(search-forward "\"")
(buffer-substring
@@ -70,14 +77,16 @@
(progn (message "Buffer clean!") t)
(message "Sorry mac, more cruft to clean") nil))
-
(defun convert-doc-buffer ()
(interactive)
(beginning-of-buffer)
(while (replace-id-macro))
(beginning-of-buffer)
- (while (goto-next-anchor)
- (replace-anchor-macro))
+ (while (goto-next-macro "anchor")
+ (replace-macro "anchor"))
+ (beginning-of-buffer)
+ (while (goto-next-macro "m")
+ (replace-macro "m"))
(beginning-of-buffer)
(while (not (is-clean-p))
(replace-doc-url)))
@@ -91,6 +100,7 @@
(define-key buster-docs-cleanup-mode-map (kbd "C-c a") 'replace-anchor-macro)
(define-key buster-docs-cleanup-mode-map (kbd "C-c i") 'replace-id-macro)
(define-key buster-docs-cleanup-mode-map (kbd "C-c c") 'convert-doc-buffer)
+ (define-key buster-docs-cleanup-mode-map (kbd "C-c p") 'fix-paragraph)
(define-key buster-docs-cleanup-mode-map (kbd "C-c C-c") 'is-clean-p))
(define-minor-mode buster-docs-cleanup-mode
View

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -2,10 +2,10 @@
<html>
<head>
<title>Buster</title>
- <link href="/css/app.css" media="screen" rel="stylesheet" type="text/css" />
+ <link href="/css/app.css" media="screen" rel="stylesheet" type="text/css">
+ <link href="/css/doc.css" media="screen" rel="stylesheet" type="text/css">
</head>
<body>
-
<div id="header">
<div id="beta_banner"></div>
<div class="centered_content">
@@ -14,7 +14,6 @@
<li><a href="/" class="active">Home</a></li>
<li><a href="/docs">Documentation</a></li>
<li><a href="/community">Community</a></li>
-
</ul>
</div>
</div>
@@ -26,19 +25,20 @@
<div id="footer">
<div class="centered_content">
<p>
- Copyright &copy; 2012, Christian Johansen and August
+ Copyright &copy; 2010 - 2012, Christian Johansen and August
Lilleaas. Buster.JS uses <a href="http://semver.org/">semantic
versioning</a>. Code released under the
<a href="http://www.opensource.org/licenses/bsd-license.php">BSD
license</a>. Documentation released under
<a href="http://creativecommons.org/licenses/by-sa/3.0/">CC
Attribution-Share Alike</a>.
</p>
-
</div>
</div>
</body>
-<script type="text/javascript">
+ <script src="/hijs.js"></script>
+ <script src="/js/toc.js"></script>
+ <script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-27522206-1']);
_gaq.push(['_trackPageview']);
@@ -48,5 +48,5 @@
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
-</script>
+ </script>
</html>
Oops, something went wrong.

0 comments on commit 9ad5bf0

Please sign in to comment.