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

Add support for subsequent author substitution #228

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

Drodt
Copy link
Contributor

@Drodt Drodt commented Oct 8, 2024

Fixes #219. Fixes #229 (as a first approximation)

Also fixes the error that affixes for bibliography layout were ignored. And updates archives.

Adds 96 tests to citeproc-pass.txt.

Still a draft until:

  • Code is reworked to be a bit nicer
  • Tests for bibliography are supported (See Support for Citeproc bibliography tests #229).
  • All relevant tests pass:
    • name_SubsequentAuthorSubstituteSingleField
    • name_SubstitutePartialEach
    • name_SubsequentAuthorSubstituteMultipleNames

@Drodt Drodt marked this pull request as ready for review October 17, 2024 07:20
@Drodt
Copy link
Contributor Author

Drodt commented Nov 25, 2024

This is ready to merge.

Copy link
Contributor

@PgBiel PgBiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, here are some initial thoughts.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please undo changes to archive files, they should be updated separately. (You can rebase on main to get the latest updates.) Thank you!

@@ -303,6 +310,39 @@ impl<'s> TestCaseBuilder<'s> {
}
}

fn extract_from_html(html: &str) -> String {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you implement bibliography test support on a separate PR? As is, it's harder to tell at a glance which changes were due to subsequent author substitution support and which changes were due to newly-supported bibliography tests.

@@ -0,0 +1,85 @@
use hayagriva::citationberg::IndependentStyle;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do wonder if this could become a local citeproc test with the new bibliography support.

Though it'd generally be nice to have better infrastructure for non-citeproc (hayagriva YAML) tests. I wonder if we could have a nice little macro which does all of this in a less repetitive way, so we can have multiple tests in a single file.

});

for i in result.bibliography.unwrap().items {
eprintln!("{}", i.content);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I also believe this should be an assertion.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Citeproc bibliography tests subsequent-author-substitute is not respected
3 participants