Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types reported by pandoc.utils.types are inconsistent #8574

Closed
tarleb opened this issue Jan 23, 2023 · 2 comments
Closed

Types reported by pandoc.utils.types are inconsistent #8574

tarleb opened this issue Jan 23, 2023 · 2 comments

Comments

@tarleb
Copy link
Collaborator

tarleb commented Jan 23, 2023

Some types have a pandoc prefix, while others do not. This should be consistent, at least for AST types.

@tarleb
Copy link
Collaborator Author

tarleb commented Jan 23, 2023

We can't add a pandoc prefix to AST types that don't have them right now, it would break many filters.

Options:

  • Remove the prefix in the names of all AST types, including Row. Downside: this adds more unprefixed entries in the Lua registry, increasing the risk of name collisions with other libraries.
  • Add the prefix to all names, but change pandoc.utils.types so it reports the name without the prefix. Downside: names in error messages would differ from the type name reported by pandoc.utils.types.

@wlupton
Copy link
Contributor

wlupton commented Jan 23, 2023

There's also the question of separators. Currently we have (for example):

  • List for pandoc.List
  • pandoc Xxx for pandoc.Row etc.
  • HsLua.JSON.array

tarleb added a commit to pandoc/pandoc-lua-marshal that referenced this issue Oct 14, 2024
tarleb added a commit to tarleb/pandoc that referenced this issue Oct 14, 2024
Lua type names were inconsistent with regard to the use of prefixes; all
prefixes are removed now, and Lua types now have the same name as the
Haskell types.

The use of app-specific prefixes is suggested by the Lua manual to avoid
collisions. However, this shouldn't be a problem with pandoc, as it
cannot be used as a Lua package.

Closes: jgm#8574
@tarleb tarleb closed this as completed in d399943 Oct 14, 2024
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jan 10, 2025
## 0.3.0

Released 2024-12-07.

  * Add method `normalize` to Pandoc objects.
    This returns a normalized document by merging adjacent spaces in inlines
    and by modifying tables.

  * Push Captions as userdata, move code to separate module.

  * Add tests for RawInline and its properties

  * Allow treatment of custom elements as singleton lists.

  * Remove `pandoc` prefix on table components (jgm/pandoc#8574).

## 0.2.9

Released 2024-10-01.

-   Update list module, thereby introducing a new method `iter`;
    the function returns an iterator that steps through list
    values on each call.

-   Added support for `__toinline` and `__toblock` metamethods. If
    the metamethods are available on a Lua object and return an
    appropriate value, then that returned value will be used
    during unmarshalling.

## 0.2.8

Released 2024-09-21.

-   Update list module, thereby introducing a new method `at` and
    an extended constructor for List types.

## 0.2.7.1

Released 2024-07-02.

-   Relaxed the upper bound of tasty-quickcheck, used in tests.
    Now allows version 0.11.

-   Update documentation on constructors; the descriptions now
    match those in the pandoc docs.

## 0.2.7

Released 2024-05-06.

-   Let the behavior of `content` attributes on BulletList and
    OrderedList elements match that of the constructor by treating
    a list of Block elements as a list of single-block items. The
    following assertion now holds true:

    ``` lua
    local content = {pandoc.Plain "one", pandoc.Plain "two"}
    local bl = pandoc.BulletList{}
    bl.content = content
    assert(bl == pandoc.BulletList(content))
    ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants