Skip to content
Browse files

Renamed 'categories' to 'topics' in function and variable names

  • Loading branch information...
1 parent 4c8259c commit a3d77e5f6a565d8ad28eb24ba616d1109ff04f98 @vsedach committed
Showing with 22 additions and 22 deletions.
  1. +5 −5 src/article.lisp
  2. +6 −6 src/indexes.lisp
  3. +3 −3 src/markup.lisp
  4. +2 −2 src/tools.lisp
  5. +6 −6 src/wiki.lisp
View
10 src/article.lisp
@@ -27,7 +27,7 @@
(defun pprint-article-link (title)
(%print-article-link title "internal"))
-(defun pprint-category-link (title)
+(defun pprint-topic-link (title)
(%print-article-link title "category"))
;;; revisions
@@ -61,10 +61,10 @@
(defun render-revision (revision &optional (content (revision-content revision)))
(generate-html-from-markup content)
- (awhen (categories content)
- #H[<div id="categories"><hr />Categories: ]
- (loop for category in it for divider = nil then t do
- (when divider #H" | ") (pprint-category-link category))
+ (awhen (topics content)
+ #H[<div id="categories"><hr />Topics: ]
+ (loop for topic in it for divider = nil then t do
+ (when divider #H" | ") (pprint-topic-link topic))
#H[</div>])
(setf
*footer*
View
12 src/indexes.lisp
@@ -1,16 +1,16 @@
(in-package #:cliki2)
(in-readtable cliki2)
-;;; categories
+;;; topics
(defun canonicalize (title)
(string-downcase (cut-whitespace title)))
-(defun categories (content)
- (let (categories)
- (ppcre:do-register-groups (category) (#?/\*\(([^\)]*)\)/ content)
- (pushnew (canonicalize category) categories :test #'string=))
- categories))
+(defun topics (content)
+ (let (topics)
+ (ppcre:do-register-groups (topic) (#?/\*\(([^\)]*)\)/ content)
+ (pushnew (canonicalize topic) topics :test #'string=))
+ topics))
;;; full-text search
View
6 src/markup.lisp
@@ -100,7 +100,7 @@
(defun parse-cliki-markup (markup)
(loop for prefix in '("_" "_H" "\\*" "\\/" "_P")
- for formatter in '(pprint-article-link format-hyperspec-link pprint-category-link format-category-list format-package-link)
+ for formatter in '(pprint-article-link format-hyperspec-link pprint-topic-link format-topic-list format-package-link)
do (setf markup (process-cliki-rule markup prefix formatter)))
markup)
@@ -125,8 +125,8 @@
+links-only+)}
</li>])
-(defun format-category-list (category) ;; /(
- #H[<ul>] (dolist (article (articles-by-category category))
+(defun format-topic-list (topic) ;; /(
+ #H[<ul>] (dolist (article (articles-by-topic topic))
(pprint-article-summary-li article "-"))
#H[</ul>])
View
4 src/tools.lisp
@@ -32,5 +32,5 @@
start
(get-all-articles (lambda (article)
(not (or (deleted? article)
- (categories (cached-content
- (article-title article)))))))))
+ (topics (cached-content
+ (article-title article)))))))))
View
12 src/wiki.lisp
@@ -24,7 +24,7 @@
(last-timestamp 0)
;; indexes
- (category-index (make-hash-table :test 'equal)) ;; article name
+ (topic-index (make-hash-table :test 'equal)) ;; article name
(search-index (make-hash-table :test 'equal)) ;; article name
(author-index (make-hash-table :test 'equal)) ;; revision obj
(recent-changes ()) ;; revision obj
@@ -158,7 +158,7 @@
(with-lock-held ((index-lock *wiki*))
(setf (recent-changes *wiki*) (remove-article-revisions
(recent-changes *wiki*)))
- ;; category and search index should be clear,
+ ;; topic and search index should be clear,
;; but need to clear out author-index
(loop for x being the hash-key of (author-index *wiki*)
using (hash-value old-rs) do
@@ -244,9 +244,9 @@
(with-lock-held ((index-lock *wiki*))
(gethash word (search-index *wiki*))))
-(defun articles-by-category (category)
+(defun articles-by-topic (topic)
(with-lock-held ((index-lock *wiki*))
- (gethash (canonicalize category) (category-index *wiki*))))
+ (gethash (canonicalize topic) (topic-index *wiki*))))
(defun reindex-article (title new-content old-content)
(let ((title-words (words title)))
@@ -262,8 +262,8 @@
(words-for-search (content)
(awhen (words content)
(union title-words it :test #'string=))))
- (reindex (category-index *wiki*)
- (categories new-content) (categories old-content))
+ (reindex (topic-index *wiki*)
+ (topics new-content) (topics old-content))
(reindex (search-index *wiki*)
(words-for-search new-content) (words-for-search old-content)))))

0 comments on commit a3d77e5

Please sign in to comment.
Something went wrong with that request. Please try again.