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 HyperlinkedImage + OrderedList components #13

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

Revxrsal
Copy link

Added 2 more components to the library which appear to be missing (???)

HyperlinkedImage

    @Test
    public void withTooltip() {
        String text = new BoldText("Example alt text").toString();
        String imageURL = "https://i.imgur.com/rP1uBWg.png";
        String redirectTo = "https://github.com/Steppschuh/Java-Markdown-Generator";
        String tooltip = "Java Markdown Generator is very useful!";
        HyperlinkedImage image = new HyperlinkedImage(text, imageURL, redirectTo, tooltip);
        System.out.println(image.toString());
    }

Would result in the following:

[![**Example alt text**](https://i.imgur.com/rP1uBWg.png "Java Markdown Generator is very useful!")](https://github.com/Steppschuh/Java-Markdown-Generator)

Which renders as (hover over):

Example alt text

Without tooltip:

    @Test
    public void withoutTooltip() {
        String text = new BoldText("Example alt text").toString();
        String imageURL = "https://i.imgur.com/rP1uBWg.png";
        String redirectTo = "https://github.com/Steppschuh/Java-Markdown-Generator";
        HyperlinkedImage image = new HyperlinkedImage(text, imageURL, redirectTo, null);
        System.out.println(image.toString());
    }

Would result in the following:

[![**Example alt text**](https://i.imgur.com/rP1uBWg.png)](https://github.com/Steppschuh/Java-Markdown-Generator)

Which renders as (hover over):
Example alt text

*Can have hyperlink as null too, with or without a tooltip*

OrderedList

    @Test
    public void renderOrderedList() {
        OrderedList list = new OrderedList();
        list.add(new OrderedListItem("An element")).add(new OrderedListItem("Another element through chaining"));
        System.out.println(list);
    }

Would create:

1. An element
2. Another element through chaining

Which results in:

  1. An element
  2. Another element through chaining

With builder:

    @Test
    public void orderedListWithBuilder() {
        OrderedList list = new OrderedListBuilder()
                .append("A")
                .append("B")
                .build();
        System.out.println(list);
    }

Would create:

1. A
2. B

Which results into:

  1. A
  2. B

Let me know if anything should be changed.

@Steppschuh Steppschuh changed the base branch from master to dev July 14, 2020 07:40
@Steppschuh Steppschuh self-requested a review July 14, 2020 07:42
@Steppschuh
Copy link
Owner

Hey, thanks a lot for your contribution!

Copy link
Owner

@Steppschuh Steppschuh left a comment

Choose a reason for hiding this comment

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

Would be nice if you could also add examples to the readme and maybe some test cases. If you don't feel like it that's also fine, in that case I'll do it later.

Revxrsal and others added 2 commits July 15, 2020 13:28
Co-authored-by: Stephan Schultz <[email protected]>
…generator/list/OrderedList.java

Co-authored-by: Stephan Schultz <[email protected]>
@Javakky
Copy link

Javakky commented Sep 5, 2022

@Steppschuh
I need this change. Can I ask for a review?

@Revxrsal
Copy link
Author

Revxrsal commented Sep 6, 2022

@Steppschuh I need this change. Can I ask for a review?

This PR is old and probably wouldn't merge correctly. I suggest you create your own fork, introduce the changes as appropriate, and create another pull request.

@Javakky-pxv
Copy link

@Revxrsal
Thanks! I'll try.

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

Successfully merging this pull request may close these issues.

4 participants