-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
175 lines (129 loc) · 5.04 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
Purpose
=======
I need a place to write my consideration, study, story. The site ppf.je.ro
was the solution up to 2006. The site is based on Zeroboard version 4. It was created
in 2003. That time I am not interesting the software development and just
want a page I can post.
Currently I am using Emacs to write all of note, article. Muse-mode that
is an Emacs module is used. The page to be written by muse-mode can
publish other text formats such as html, latex, pdf, texi. I can more
conveniently write and maintain my note with Emacs and Emacs modules such
as muse-mode, planner-mode, outline-mode, fill-mode, abbrev-mode,
flyspell-mode, etc. Most powerful thing is I can freely modify and combine
the modules. It is the main problem when I used Microsoft Office.
Main problem of previous site is the spam for comment. Zeroboard is a
famous free webboard in Korea. I think that there is spam bot for
Zeroboard version 3. One day in 2008 I was reading the posts I written. I
surprised some page has hundreds of comments. All the comments are spam. I
permit the commenting for only registered users. However, I couldn't stop
spam. The bot automatically join and continuously comments the spam. The
author of Zeroboard version 4 currently doesn't maintain Zeroboard version
4 any more. I have to fix that.
Another problem is to maintain the articles and the comments with Emacs. I
want to write the article with muse-mode and to maintain the comments with
gnus which is an Newsreader of Emacs. It requires some modification and
third party tools.
This is my solution. Convenient editing for the source and the article is
a main goal. There is no consideration the use of other user. But someone
want to that, I will explain/add the code for more readable code. I think
the interesting is good payment for coding.
- Convenient writing of a article (for me).
- Convenient configuring of a article (for me).
- Convenient configuring of program (for me).
Requirements
============
- python: I am using 2.7. Not tested in other version.
- emacs lisp
- jinja2(added)
- pymacs
- muse-mode of emacs
- json-mode of emacs
- scrubber(added)
- BeautifulSoup(added)
- flask
- werkzeug
(Optional)
- ftp server: server side
- nosetest
- doctest
Using
=====
Notice: Current versions depends my emacs configuration. I had not
considered other the use of other users. So it has fewer documentation.
Someone want to use this and has problems. Please comment. I will happy to
reply.
- http://ppf.je.ro : Demo
Upload
------
1. Download with "git clone https://github.com/ptmono/ppf.git"
2. Config config.py.
3. Correct the permission of your files. Your web server can read/write
required directories.
4. Upload the file with following command. The file permission is also
translated. You need ftp service in server side.
- python tools/uploader.py --with-config
Or manually upload the files.
Emacs
-----
1. Configure tools/ppf.el
2. load ppf.el.
(add-to-list 'load-path "YOUR_PATH/tools/ppf.el")
(require 'ppf)
3. M-x ppf-report will list your articles.
Writing article
---------------
You article start with directives such as
1201132049.muse
#title Screen capture in Windows
#author dalsoo
#date 1205220748
#update 1205220748
#tag tools
#category tools
#climit 3
#unpublished true
Content ...
The "climit" will determines the number of maximum comment. The
"unpublished" determines show/hide of the article on the web. "true" means
that anyone can not see this article from his browser.
This file is written by muse-mode of emacs. The name of file is
"1201132049.muse". It is current time. I am using following code to create
the time.
(defvar d-myel-previous-time nil)
(defun d-insert-time ()
"Inserting current time with \"\#\" e.g #0606300955 and rememberf this"
(interactive)
(let* ((current-time (d-create-citation)))
(progn
(kill-new current-time)
(yank)
(setq d-myel-previous-time current-time))))
(defun d-create-anchor ()
(concat "#" (d-create-citation)))
(defun d-create-citation ()
(let* ((current-time (d-current-time)))
(if d-myel-previous-time
(when (>= (string-to-number d-myel-previous-time)
(string-to-number current-time))
(setq current-time
(number-to-string
(+ (string-to-number d-myel-previous-time) 1)))))
current-time))
(defun d-current-time ()
"create current time"
(format-time-string "%y%m%d%H%M" (current-time)))
Publish the muse article with the function 'muse-publish-this-file' of
muse-mode. Or tools/ppf.el contains the function 'ppf/article-publish'.
ppf.el also contains following functions and keybinded.
(define-key muse-mode-map [?\C-c ?p ?p] 'ppf/article-publish)
(define-key muse-mode-map [?\C-c ?p ?v] 'ppf/article-preview)
(define-key muse-mode-map [?\C-c ?p ?u] 'ppf/article-update)
(define-key muse-mode-map [?\C-c ?p ?i ?u] 'ppf/article-update)
(require 'python)
(define-key python-mode-map [?\C-c ?p ?u] 'ppf/upload-this-file)
- ppf/article/publish: Convert muse to html
- ppf/article-preview: Show me current article with web browser
- ppf/article-update: Upload this article to web
TODO
====
- See todo.muse