AmpersandTarski / Ampersand

Build database applications faster than anyone else, and keep your data pollution free as a bonus.
http://ampersandtarski.github.io/
GNU General Public License v3.0
40 stars 8 forks source link

Hyperlink reference in Conceptual Analysis #1264

Open stefjoosten opened 2 years ago

stefjoosten commented 2 years ago

What happened

I generated a Word document from an Ampersand script. It documents a rule as follows:

afbeelding

What I expected

I expected to see a readable name. I used Ampersand-v4.6.1

Observations

The file 'SharedAmongChapters.hs' shows this piece of code: afbeelding

hanjoosten commented 2 years ago

Xreferences are broken loooooooong time. We are still waiting for this PR to hit the road.

stefjoosten commented 2 years ago

@lierdakil, Nikolay, are there any plans to make Pandoc references work in the near future?

lierdakil commented 2 years ago

There are some issues with "that PR", and I doubt I'll find the time to whip it into shape particularly soon (it's been like this for a while). That said, @hanjoosten, if you explain what the issue is, perhaps we'll be able to just hack something into the stable branch?

hanjoosten commented 2 years ago

In short, a user of Ampersand compiles a specification written in our DSL. The user can generate a document based on his specification. We programatically generate a Pandoc data structure, representing that document. The document can contain several things, that we want to have a cross references to. These things have types, such as definition, expression, image etc. So in the document we want to be able to generate:

It has been some time ago that I wrote the code for this. Each of the above types has its own datatype in the Haskell code. So I think I need something like

class Xreferenceble a where
  anchor :: a -> Inline
  referTo :: a -> Inline

In writing the instances for each of the types, I hope to use definitions from pandoc-crosref. Our current implementation doesn't give the required results, as @stefjoosten pointed out. @lierdakil , I would very much appreciate if you could hack something into the stable branch of pandoc-crosref.

stefjoosten commented 2 years ago

Oops