>
> In that case, does it work if you simply remove the call to `decode-flow`
> from the definition of `markdown-inline`? Then the function would
> just return a list of pre-parts to be spliced into the enclosing document.
>

Doh. It appears to indeed!


> If you want to make the Markdown sections properly nest under the current
> section, you would probably need to adjust the depths of all `part-start`
> instances in the result. For example, if you use `markdown-inline` within a
> subsection, you would probably want to increase the depth of all
> part-starts by 2. I don't know if it's possible to find the current depth
> automatically, so you might need to make it an extra argument to
> `markdown-inline`.
>

Thanks.


>
> I also would have expected calling `decode` and then extracting and
> appending the blocks and parts to work, although it would have different
> behavior wrt the trailing text. Your original message said that didn't
> work, but how did it fail?
>

Yeah, I can't even remember all the things I tried.

I think there's value to figuring out a good set of abstractions here.
There's real value to being able to have, e.g., co-authors who can only
handle Markdown incorporate their work into Scribble pages. For now, with
my semester under way, I think I'll pass on that task (-:. Hopefully this
thread is useful to someone else who comes along and needs to do this.
Short and final version:

@(define (markdown-inline file)
   (pr
     (xexprs->scribble-pres
       (with-input-from-file file read-markdown))))

Shriram

Shriram


>
> Ryan
>
>
> On Sun, Sep 13, 2020 at 1:50 PM Shriram Krishnamurthi <shri...@gmail.com>
> wrote:
>
>> It's useful to have this behave like a `#include`. There are settings
>> where you want to have a non-Scribble person author things that go "in the
>> middle"; you want to think of this as just a more convenient way of writing
>> what you'd have written in Scribble.
>>
>> I realize there's presumably a closure issue (`section` isn't going to
>> come from the including file), and for that you probably want a different
>> include form as well.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAJUf2ySAir23z0uPYsZunszhoUqdH7HOv7RihCA3tHYSGxq4Jg%40mail.gmail.com.

Reply via email to