Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for AsciiDoc(tor)/reS formats #12

Closed
gour opened this issue Apr 23, 2017 · 12 comments
Closed

support for AsciiDoc(tor)/reS formats #12

gour opened this issue Apr 23, 2017 · 12 comments

Comments

@gour
Copy link

gour commented Apr 23, 2017

Hello,

thank you for very interesting package!

Considering I plan to use AsciiDoc(tor) markup with Hugo, what do you think to extend the package by adding support for AsciiDoc(tor)/reST markup formats?

@masasam
Copy link
Owner

masasam commented Apr 23, 2017

Hi gour.
Thank you for an interesting proposal.
I didn't know AsciiDoc(tor)/reST.
I will add support for AsciiDoc(tor)/reST markup formats.

@masasam
Copy link
Owner

masasam commented Apr 24, 2017

Hi @gour .
Added support for AsciiDoc(tor)/reST markup formats, so try using it.
Please report if there is a problem.

@gour
Copy link
Author

gour commented Apr 24, 2017

@masasam Thank you very much for adding it!

Please report if there is a problem.

There is one thing I can think of...adding ability to configure list of extensions for each markup, e.g. besides *.ad, the *.adoc or *.txt are common formats used for AsciiDoc(tor) files, similar with reST where *.txt is quite common one, so my idea is that instead of depending just on hard-cored extensions, it would be nice to provide ability that user provides his/her own (a)list for each markup format by adding to the default extension and then the code should just iterate through the list while detecting correct format?

I'd gladly help, but, unfortunately, my current Elisp skills are inadequate although I hope to improve it in the future.

@masasam
Copy link
Owner

masasam commented Apr 25, 2017

Hi @gour .
Added support for changing the extension of markdown and asciidoc, so try using it.
Please select *.ad or *.asciidoc or *.adoc at extension.
Because only these three are supported by hugo.
*.txt is not support in hugo.
For example, write at your init.el ...
(setq easy-hugo-asciidoc-extension "asciidoc")

@gour
Copy link
Author

gour commented Apr 25, 2017

@masasam
What is wrong:

Debugger entered--Lisp error: (error "Please enter .md or .org or .adoc or .rst or .mmark or .html file name")
  signal(error ("Please enter .md or .org or .adoc or .rst or .mmark or .html file name"))
  error("Please enter .%s or .org or .%s or .rst or .mmark or .%s file name" "md" "adoc" "html")
  easy-hugo-newpost("test.adoc")
  funcall-interactively(easy-hugo-newpost "test.adoc")
  call-interactively(easy-hugo-newpost nil nil)
  command-execute(easy-hugo-newpost)

considering that I defined:

(setq easy-hugo-asciidoc-extension "adoc")

in my init.el and just wanted to create new test.adoc file?

@masasam
Copy link
Owner

masasam commented Apr 25, 2017

Hi @gour
Are you using MELPA?
If you are using melpa, please tell me the version of line 7.
Package-Version: 20170425.520?

@gour
Copy link
Author

gour commented Apr 25, 2017

Are you using MELPA?

Yes

If you are using melpa, please tell me the version of line 7.
Package-Version: 20170425.520?

;; Package-Version: 20170425.520

@gour
Copy link
Author

gour commented Apr 25, 2017 via email

@masasam
Copy link
Owner

masasam commented Apr 25, 2017

@gour Could you show me your init.el.

@gour
Copy link
Author

gour commented Apr 26, 2017

@masasam here is the relevant part:

(use-package easy-hugo
  :ensure t
  :config
  (setq easy-hugo-basedir "~/prj/hugo/net/")
  (setq easy-hugo-url "https://my.domain.tld")
  ;;(setq easy-hugo-sshdomain "blogdomain")
  (setq easy-hugo-root "/home/gour/prj/hugo/net/")
  (setq easy-hugo-previewtime "300")
  (setq easy-hugo-asciidoc-extension "adoc")
  :bind ("C-c C-e" . easy-hugo)
 )

@masasam
Copy link
Owner

masasam commented Apr 26, 2017

Hi @gour .

It worked. Try this ...

(use-package easy-hugo
:init
(setq easy-hugo-basedir "~/prj/hugo/net/")
(setq easy-hugo-url "https://my.domain.tld")
(setq easy-hugo-root "/home/gour/prj/hugo/net/")
(setq easy-hugo-previewtime "300")
(setq easy-hugo-asciidoc-extension "adoc")
(setq easy-hugo-default-ext ".adoc")
:bind ("C-c C-e" . easy-hugo)
)

@gour
Copy link
Author

gour commented Apr 26, 2017

Ahh, the trick is to put setup under

:init

section instead of

:config

Yes, that helps!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants