GithubHelp home page GithubHelp logo

Comments (8)

xiaohanyu avatar xiaohanyu commented on July 22, 2024

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.

xiaohanyu avatar xiaohanyu commented on July 22, 2024

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 and trim-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.

xiaohanyu avatar xiaohanyu commented on July 22, 2024

hi, kelvin, how do you think about this idea?

I need your feedback to do further refinement work.

from org-page.

sillykelvin avatar sillykelvin commented on July 22, 2024

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.

sillykelvin avatar sillykelvin commented on July 22, 2024

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.

sillykelvin avatar sillykelvin commented on July 22, 2024

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.

xiaohanyu avatar xiaohanyu commented on July 22, 2024

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.

sillykelvin avatar sillykelvin commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.