You can use --standalone flag:  https://pandoc.org/MANUAL.html#option--standalone

Then you can write a Lua filter which removes everything except a attributed tagged paragraph

# References  {keep=true}

You need to check that attribute `keep` in the filter
as a start:

https://pandoc.org/lua-filters.html#setting-the-date-in-the-metadata
https://github.com/pandoc/lua-filters

Maybe something like:
```lua
function remove(block)
    if block.attributes["keep"] == "true" then
        return nil -- keep the block
    end
   else pandoc.List() -- remove the whole block
end

function Pandoc(el) 
    pandoc.walk_block(pandoc.Div(el.blocks), {Blocks = remove} )
    os.exit(0)
end
```

Am 18.11.2020 um 13:07 schrieb King John Unn:

hello community,

I am a new user to pandoc. I am trying to generate the bibliography for a document. My template looks like this:

```
$body$
```

This allows me to create a plain text document from markdown without header, title, toc, etc.

```
body text with references...

References

reference 1
...
reference n
```

I want to remove the body, too and only stick with:

```
References

reference 1
...
reference n
```
```

Is it possible to generate the reference only? If possible i would like to further modify the format of references, too.
--
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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/89f878c1-770d-4d21-b372-15961fb5e385n%40googlegroups.com.

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/92029b56-4758-2713-16d1-ffca9f3ac786%40gmail.com.