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

Feature/bibl visualization #238

Merged
merged 29 commits into from
Jun 27, 2024
Merged

Feature/bibl visualization #238

merged 29 commits into from
Jun 27, 2024

Conversation

laurelled
Copy link
Contributor

This feature adds the 'Bibliography' visualization panel in the project info modal.

The panel features a list of all bibliographic entries in the TEI edition, styled with a specific bibliographic style (for example, the Chicago Author-Date, which is the default style).
The visualization component (StyledBiblioEntryComponent) is generic, and depends on the configuration that represents a bibliographic style in ui_config.json. This can prove useful for future extension of the bibliographic style allowed, and to enable the user to add their own customized bibliographic style.

The panel has been tested with a mock-up that includes edge cases such as unstructured BibliographicEntry and BibliographicStructEntry with multiple monogr. For the former, styling is not possible thus the plain text content is visualized, and for the latter a proposal of styling reprints has been made, since there was no clear documentation on how to handle multiple monogr.

The modified edition for testing is available here

@Input() data: BibliographicEntry | BibliographicStructEntry;
@Input() style: string = AppConfig.evtSettings.ui.defaultBibliographicStyle;

public biblEntry;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please declare type of variable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be tricky to change, as I'm using a dynamic assignment to make biblEntry either be a BibliographicEntry or BibliographicStructEntry, but if it's needed to understand the code I'll refactor it.

Copy link
Contributor

Choose a reason for hiding this comment

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

as a suggestion you can declare as public biblEntry: BibliographicEntry | BibliographicStructEntry;
if it doesn't work decalare as any

@@ -15,5 +15,14 @@ export class BibliographicEntriesParserService {
.map((bib) => bibliographicParser.parse(bib));
}

parseBibliographicEntries(xml: XMLElement) {
Copy link
Contributor

Choose a reason for hiding this comment

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

please declare type of return variable

protected attributeParser = createParser(AttributeParser, this.genericParse);
protected elementParser = createParser(GenericElemParser, parse);

protected getTrimmedText = function(s): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

what type of variable is s?

@@ -49,7 +49,8 @@ export class ModalComponent implements OnInit {
@HostListener('click', ['$event'])
clickout(event) {
Copy link
Contributor

Choose a reason for hiding this comment

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

please specify type of event (at least any)

Copy link
Contributor Author

@laurelled laurelled May 20, 2024

Choose a reason for hiding this comment

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

I didn't create the function, but I'll look into more details when I have time to spare

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it your configuration or is valid for any project?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's supposed to be valid for any project, I've added some keywords but their naming is still open to feedback

laurelled added 27 commits June 21, 2024 10:12
@laurelled laurelled force-pushed the feature/bibl-visualization branch from 5920443 to c7789d8 Compare June 21, 2024 14:23
@laurelled laurelled merged commit dcc6c82 into develop Jun 27, 2024
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.

2 participants