Skip to content

Feature Request: post-subtree-as-page #142

Closed
tntdynamight opened this Issue Nov 22, 2013 · 11 comments

3 participants

@tntdynamight

Hi, hope this is the appropriate place for this.

First of all, great work that you are doing! Love it!

I was wondering if it is possible to include an option for:
post-subtree-as-page and post-subtree-as-page-and-publish

That would be most amazing; and, for a future outlook, even more so with the option to automatically put the page as a child of parent pages according to the tree-structure of the Current buffer!

Any chance?
best
tnt

@titaniumbones
Collaborator

Hi TNT, this is a great feature request. Puneeth is very busy and the rest of u are very slow programmers. If you want to start work on this that would be great! And maybe we cna help out. thanks,
matt

@punchagan
Owner

More than busy, it is lack of motivation to maintain org2blog, since I don't use it anymore. :(

Adding the feature to post subtree as page should be relatively straight forward.

The other feature, not so much. But, it shouldn't be too hard.

@punchagan
Owner

I have added the methods requested, on the org-8-experimental branch. @tntdynamight, it would help if you can try it out and report issues! Thanks!

@tntdynamight

Hey, that is great (the implementation) and sad (that you don't have good use for it anymore).

Thanks for the quick action!

Concerning the implementation, on first glance, with the experimental branch, publish-buffer-as-page works, but for publish-subtree, I get: "symbol's function definition as a variable is void: when-buffer-file-name"
This function isn't called in the main branch, and also not in the 'post-buffer' routine. I'll let you know if I find out more but my understanding of these things is mostly superficial..
But maybe it's just a usage issue, I am just starting and still finding my way around the properties..

cheers
tnt

@tntdynamight

So I think that was just a simple typo, it should be:
"when buffer-file-name" instead of "when-buffer-file-name"
Now it successfully publishes my subtrees as pages =)
but ignores the permalink option. =(

@punchagan
Owner

Thanks for pointing out the bug. Fixed.

What is the permalink option?

@tntdynamight

Also the 'parent' doesn't work, which is actually more important, as 'permalink' can be set sensibly by post-name in wordpress directly..
Cheers
tnt

@tntdynamight

Oh, sorry, I mean the options to pass along to set the permalink and post/page parent:

#+PARENT: subtree
#+PERMALINK: sub2

@tntdynamight

Hmm, so some more details on this so far:
It actually correctly completes the Parent into the subtree line of the .org file from the wp-list.
It also correctly sets the parent on the resulting wp page if I create a new entry and use post-buffer-as-page, but it doesn't using post-subtree-as-page. It should work, as post-subtree-as-page actually calls post-buffer-as-page.
I'm speculating it has to do on restrictions when and how subtree-p is called but I haven't found the problem yet. I'll try to keep looking these days.

Cheers
tnt

@tntdynamight

Ok after some slow and low-tech debugging I found that there is a problem in wp-parse-entry in the subtree section, specifically that org-entry-get (point) doesn't return the right values.
I thought of a symptomatic fix, using instead:

(org-narrow-to-subtree)
(org2blog/wp-get-option "PARENT")
(widen)

I haven't checked carefully if this breaks any of the other values (it does break the title option, which has to be before the narrowing), so I'm not sure if I should commit a pull request (I forked the experminental branch).

Another note, but more of a sideline for users who don't get it to work: it only works if in o2b mode and having performed login first.

Just wanted to share what I found, if I should make a pull request please let me know,

cheers and good sunday,
tnt

@punchagan punchagan added a commit that closed this issue May 29, 2014
@punchagan Allow parent to be the parent id, along with name.
Also, add tests to check if parent is correctly parsed. Fixes #142.
be814c4
@punchagan punchagan closed this in be814c4 May 29, 2014
@punchagan
Owner

@tntdynamight This should be fixed now. PARENT can now be set to parent id, to not have the user to login. If PARENT is a name, the code prompts the user to login. Feel free to reopen, if it is not fixed for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.