Comments (8)
I've do some exploring work on page-header, see
I think mustache is much more self-evident, thus can avoid many comments about template tags(%c, %g, etc).
The shortage of https://github.com/Wilfred/mustache.el is that mustache.el and its dependencies is not quite mature, maybe, since many of them(ht.el, loop.el, with-namespace.el, all from Wilfred) has a short history. But I've seen some of Wilfred's code, I think it quite good.
from org-page.
Ah, I've found a quote in code:
"Remove whitespace at the beginning and STR. The function is copied from https://github.com/magnars/s.el, because I do not want to make org-page depend on other libraries, so I copied the function here, so do
trim-string-left
andtrim-string-right
."
I thinks it's unwise to worry about dependencies, modern tools from emacs(such as el-get, packages.el) has good solution for dependencies now). So I think if a library is good, just use it.
IMHO, string/regexp manipulation from elisp is not as good as string/regexp library from other languages such as Python, string/regexp matching use lots of global variable(similar to Ruby), which makes code not so straight forward. And org-page do use lots of string/regexp functions, So I think import extra good library such as s.el has more goodies than not importing it.
Waiting for your advice.
from org-page.
hi, kelvin, how do you think about this idea?
I need your feedback to do further refinement work.
from org-page.
Hi hanyu, sorry for late response that these two days I was busy on my company's work. I did some research on mustache
you introduced, it is really a good template system, and use {{ page-title }}
is really much better than %t
, so, please go ahead of your refinement, thanks for your hard work to org-page~ :-)
from org-page.
And, I want to do some explanation that why I did not import the dependency of s.el
:
As you see, org-page imported three utility functions of s.el
(in fact it is only one, the other two are not directly used by org-page), it is NOT heavily depended on s.el
, so, import a new library but only uses its one interface conflicts with the simplicity principle. So I justed copied the utility function org-page needed.
And, as an editor, or course emacs is good at string/regexp manipulation, but I do admit that its string/regexp manipulation is not so directviewing and handy, but it is enough for org-page. And as you see, s.el
is based on emacs' built-in string/regexp manipulation function, what it does, is just make it more handy to use.
But mustache
is not the same, I think if we use this template system than the original simple format-spec
, it will be heavily depended by org-page, and also, mustache
is not like s.el
, the latter is just a utility function library. So, import the dependency of mustache.el
is welcome. :-D
from org-page.
And, I will be on my holiday in next three days, if you have any pull requests, issues or comments, just leave them there, I will handle them after I am back, thank very much.
from org-page.
Unfortunately, mustache.el
depends on extra library, including ht.el
, s.el
, dash.el
and with-namespace.el
. So I think a more detailed discussion is needed, and maybe we can provide an extra bundled version of org-page with depedent library included?
I'll try my best to do more exploring work in the next three days, maybe including some TDD practice with emacs ert. You're right that import extra dependencies break the simplicity, but we should consider whether or not it worth it.
What I want is a static blog generator based on emacs org-mode, something like https://github.com/getpelican/pelican or http://ruhoh.com/. To tell the truth, I was totally rocked by emacs org-mode, expecially org-publish and org-babel, that's why I want to stick on org-mode, and then found org-page, then try to make some coding work.
And finally, good luck with you and enjoy your holidays!
from org-page.
Sorry I did not notice the latest reply, github did not email a notification to me about your reply.
After I did some research on emacs' package system, I find it is quite easy to install packages, previously why I am concern about 3rd party dependency is because I do manual package management so I do not like a lot dependencies.
Now I have introduced mustache.el
into org-page, it is much more readable than format-spec
.
from org-page.
Related Issues (20)
- Change default category "Blog" title ? HOT 10
- Wrong type argument: listp HOT 2
- How to add a small preview of posts in the index page? HOT 1
- wrong-type-argument lisp #("About" 0 5 (:parent (#1))) HOT 3
- I cannot get generated html posts HOT 4
- Cannot change date format in generated category indexes HOT 2
- Org-page does not ignore the themes folder HOT 3
- mapcar: Symbol’s value as variable is void: plist HOT 4
- Symbol's function definition is void:seq-take HOT 2
- missing items : blog index and rss HOT 1
- generate CNAME file HOT 1
- site domain / HOT 1
- org mode 下载两次 HOT 2
- Placement of Google Analytics code?
- Tags header generates twice HOT 3
- Spacemacs documentation?
- rss Podcast
- Improved image handling
- Two machines
- The new upstream doesn't exist anymore HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from org-page.