[-- Attachment #1: Type: text/plain, Size: 484 bytes --] I'm using the most recent wip-cite-new branch of org, with a recent emacs git (28.0.50). I would like to be able to surround some portion of a subtree with a tag, e.g.: * parent some text #+HTML: <div class="box"> ** child 2 some boxed content ** child 2 more boxed content #+HTML:</div> ** child 3 unboxed content However, org seems to close the div for me before the ~** child 2~ headline. Is this the intended behaviour? And if so is there any way for me to do this? [-- Attachment #2: Type: text/html, Size: 697 bytes --]
[-- Attachment #1: Type: text/plain, Size: 1254 bytes --] On Mon, Jun 21, 2021 at 3:07 PM Matt Price <moptop99@gmail.com> wrote: > I'm using the most recent wip-cite-new branch of org, with a recent emacs > git (28.0.50). > > I would like to be able to surround some portion of a subtree with a tag, > e.g.: > > * parent > some text > #+HTML: <div class="box"> > ** child 2 > some boxed content > ** child 2 > more boxed content > #+HTML:</div> > ** child 3 > unboxed content > > However, org seems to close the div for me before the ~** child 2~ > headline. > > Is this the intended behaviour? And if so is there any way for me to do > this? > Sorry for the noise, I believe this is user error. I misread the exported source code, and firefox's developer tools added the closing tag for me, so I kept not seeing my mistake. The error here was not realizing that section contents get wrapped in their own div with class ~outline-text-N~, so my ~<div class="box">~ resulted in malformed HTML. I don't know if there is a way to somehow slide my own html in between the outine-text element and the outline-container element for a child subtree. If someone knows a way to do this, I'd appreciate a pointer, but for now I think I have to find another way to accomplish this. thanks & apologies, Matt [-- Attachment #2: Type: text/html, Size: 1875 bytes --]
Hi Matt, Matt Price <moptop99@gmail.com> writes: >> I would like to be able to surround some portion of a subtree with a tag, >> e.g.: >> >> * parent >> some text >> #+HTML: <div class="box"> >> ** child 2 >> some boxed content >> ** child 2 >> more boxed content >> #+HTML:</div> >> ** child 3 >> unboxed content > I don't know if there is a way to somehow slide my own html in between the > outine-text element and the outline-container element for a child subtree. > If someone knows a way to do this, I'd appreciate a pointer, but for now I > think I have to find another way to accomplish this. Is it important that your two headlines in the boxed content export as <h2>? If not, you could just use a structure like * Parent ** Box *** Boxed Child 1 *** Boxed Child 2 ** Unboxed Child and use something like the ignoreheading filter (see Worg's "Org Hacks" page) to prevent "Box" from producing a separate header, and maybe various properties (e.g. UNNUMBERED?) to keep the boxed children from appearing as part of the main outline. Otherwise, #+INCLUDE comes to mind as a possible solution. Would one of those options work for you? -- Best, Richard
[-- Attachment #1: Type: text/plain, Size: 1507 bytes --] On Tue., Jun. 22, 2021, 4:30 a.m. Richard Lawrence, < richard.lawrence@uni-tuebingen.de> wrote: > Hi Matt, > > Matt Price <moptop99@gmail.com> writes: > > >> I would like to be able to surround some portion of a subtree with a > tag, > >> e.g.: > >> > >> * parent > >> some text > >> #+HTML: <div class="box"> > >> ** child 2 > >> some boxed content > >> ** child 2 > >> more boxed content > >> #+HTML:</div> > >> ** child 3 > >> unboxed content > > > I don't know if there is a way to somehow slide my own html in between > the > > outine-text element and the outline-container element for a child > subtree. > > If someone knows a way to do this, I'd appreciate a pointer, but for now > I > > think I have to find another way to accomplish this. > > Is it important that your two headlines in the boxed content export as > <h2>? > > If not, you could just use a structure like > > * Parent > ** Box > *** Boxed Child 1 > *** Boxed Child 2 > ** Unboxed Child > > and use something like the ignoreheading filter (see Worg's "Org Hacks" > page) to prevent "Box" from producing a separate header, and maybe > various properties (e.g. UNNUMBERED?) to keep the boxed children from > appearing as part of the main outline. > > Otherwise, #+INCLUDE comes to mind as a possible solution. > > Would one of those options work for you? > I think the :ignore: hack will not work quite right, but the others I had not thought of at all, and I will try them out! Thank you, Matt > > -- > Best, > Richard > [-- Attachment #2: Type: text/html, Size: 2428 bytes --]
Matt Price <moptop99@gmail.com> writes: >> I would like to be able to surround some portion of a subtree with a tag, > Sorry for the noise, I believe this is user error. I misread the exported > source code, and firefox's developer tools added the closing tag for me, so > I kept not seeing my mistake. The error here was not realizing that section > contents get wrapped in their own div with class ~outline-text-N~, so my > ~<div class="box">~ resulted in malformed HTML. > > I don't know if there is a way to somehow slide my own html in between the > outine-text element and the outline-container element for a child subtree. > If someone knows a way to do this, I'd appreciate a pointer, but for now I > think I have to find another way to accomplish this. As it so happens, this is something which has come up for me too. I think in the future it could be worth adding a property that can be used to wrap a section in certain HTML tag(s). For now though... the best solution would be what Richard suggests. -- Timothy
[-- Attachment #1: Type: text/plain, Size: 1766 bytes --] On Thu, Jul 1, 2021 at 12:18 PM Timothy <tecosaur@gmail.com> wrote: > > Matt Price <moptop99@gmail.com> writes: > > >> I would like to be able to surround some portion of a subtree with a > tag, > > > Sorry for the noise, I believe this is user error. I misread the > exported > > source code, and firefox's developer tools added the closing tag for me, > so > > I kept not seeing my mistake. The error here was not realizing that > section > > contents get wrapped in their own div with class ~outline-text-N~, so my > > ~<div class="box">~ resulted in malformed HTML. > > > > I don't know if there is a way to somehow slide my own html in between > the > > outine-text element and the outline-container element for a child > subtree. > > If someone knows a way to do this, I'd appreciate a pointer, but for now > I > > think I have to find another way to accomplish this. > > As it so happens, this is something which has come up for me too. I > think in the future it could be worth adding a property that can be used > to wrap a section in certain HTML tag(s). > I'm dealing with it again tonight, and I do find it a bit teeth-gnashing. In this case what I'm looking to do is to hide a whole section when the exported hTML page loads. But right now the subtee children of the headline remain visible even when the text is hidden. Whoa! I just realized I can rewrite this myself, since it's a derived bakend. I guess the export happens from the leafs upwards, so that the contents are already rendered by the time theadline is being processed. So in my headline exporter, just had to wrap the contents in an additional div. It works fine, I feel great about it! > > For now though... the best solution would be what Richard suggests. > > -- > Timothy > [-- Attachment #2: Type: text/html, Size: 2460 bytes --]