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

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

Comments

Projects
None yet
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

This comment has been minimized.

Show comment
Hide comment
@titaniumbones

titaniumbones Nov 22, 2013

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

Collaborator

titaniumbones commented Nov 22, 2013

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

This comment has been minimized.

Show comment
Hide comment
@punchagan

punchagan Nov 23, 2013

Member

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.

Member

punchagan commented Nov 23, 2013

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

This comment has been minimized.

Show comment
Hide comment
@punchagan

punchagan Nov 23, 2013

Member

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!

Member

punchagan commented Nov 23, 2013

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

This comment has been minimized.

Show comment
Hide comment
@tntdynamight

tntdynamight Nov 24, 2013

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

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

This comment has been minimized.

Show comment
Hide comment
@tntdynamight

tntdynamight Nov 24, 2013

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. =(

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

This comment has been minimized.

Show comment
Hide comment
@punchagan

punchagan Nov 24, 2013

Member

Thanks for pointing out the bug. Fixed.

What is the permalink option?

Member

punchagan commented Nov 24, 2013

Thanks for pointing out the bug. Fixed.

What is the permalink option?

@tntdynamight

This comment has been minimized.

Show comment
Hide comment
@tntdynamight

tntdynamight Nov 24, 2013

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

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

This comment has been minimized.

Show comment
Hide comment
@tntdynamight

tntdynamight Nov 24, 2013

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

#+PARENT: subtree
#+PERMALINK: sub2

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

#+PARENT: subtree
#+PERMALINK: sub2

@tntdynamight

This comment has been minimized.

Show comment
Hide comment
@tntdynamight

tntdynamight Nov 25, 2013

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

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

This comment has been minimized.

Show comment
Hide comment
@tntdynamight

tntdynamight Dec 15, 2013

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

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 closed this in be814c4 May 29, 2014

@punchagan

This comment has been minimized.

Show comment
Hide comment
@punchagan

punchagan May 29, 2014

Member

@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.

Member

punchagan commented May 29, 2014

@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