public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: "Jörn K" <tarsoniusvonbethana-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Pandoc JSON schema
Date: Mon, 19 Jun 2023 02:32:17 -0700 (PDT)	[thread overview]
Message-ID: <16e8b004-f3c8-4a4e-a6e6-856f45f3bdd5n@googlegroups.com> (raw)
In-Reply-To: <CE12DC92-2BD1-429F-B266-EF9D3231A982-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 1939 bytes --]

Hi!

Is stumbled upon this while trying to use json-schema to enforce a certain 
format and content of a markdown document. Our use-case is enforcing the 
layout and data entered in standardized technical reports for a project of 
our institute.

Basically I have a json-schema prepared and have a test in which a python 
script (using jsonschema) validated Pandoc's json output. 
So far it has proven quite mighty, but sadly it is cumbersome to write the 
schema manually as there is quite some nesting of properties involved.

 Currently I am pondering if one could use a (Lua) writer to generate such 
a schema. One could lookout for certain attributes to set json-schema 
validation options. This way the feature of validating the contents of a 
document against a schema would come one step closer to less json prone 
users.

Is there a way to get the pandoc type string of a pandoc object in Lua? I 
mean the value which goes into the t property of json. I mean one can 
simply map the output of pandoc.util.type with knowledge of the current 
section, but this seems less desirable than getting the string directly 
from pandoc.

Thanks!

Jörn

John MacFarlane schrieb am Donnerstag, 29. Dezember 2022 um 21:37:08 UTC+1:

> Is there a way to programatically test a document against this schema?
>
> > On Dec 28, 2022, at 1:44 AM, Harsh Donga <ha...-7+aFW328pE6p1wGUEcWPqti2O/JbrIOy@public.gmane.org> 
> wrote:
> > 
> > PFA: pandoc AST json schema (pandoc-types 1.22)
> > 
>
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/16e8b004-f3c8-4a4e-a6e6-856f45f3bdd5n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 2666 bytes --]

      parent reply	other threads:[~2023-06-19  9:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-24 11:16 Albert Krewinkel
     [not found] ` <87bmkwdcdr.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2017-10-24 16:47   ` John MACFARLANE
2017-10-24 16:53     ` John MACFARLANE
2017-10-25  7:47       ` Albert Krewinkel
     [not found]         ` <877evjd5yg.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-11-02 14:41           ` Harsh Donga
     [not found]             ` <8d53751b-a59c-43fb-a7e1-4f5079903e28n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-11-02 15:11               ` Albert Krewinkel
     [not found]                 ` <87pme55qyx.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-11-02 15:24                   ` Harsh Donga
     [not found]                     ` <81054dc7-a893-4f84-9ce4-ea90f997b12fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-11-02 15:58                       ` Albert Krewinkel
     [not found]                         ` <87leot5otd.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-12-06  1:04                           ` John MacFarlane
     [not found]                             ` <AC7F0C0B-122B-4BF6-BC02-81FC4BA4B37C-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-12-06 15:44                               ` Albert Krewinkel
     [not found]                                 ` <874ju8wn22.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-12-28  9:44                                   ` Harsh Donga
     [not found]                                     ` <4e6dd89d-1dd0-40bb-a760-e3468c5b2403n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-12-29 20:37                                       ` John MacFarlane
     [not found]                                         ` <CE12DC92-2BD1-429F-B266-EF9D3231A982-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2023-06-19  9:32                                           ` Jörn K [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16e8b004-f3c8-4a4e-a6e6-856f45f3bdd5n@googlegroups.com \
    --to=tarsoniusvonbethana-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).