DEV Community

Marco Pasqua
Marco Pasqua

Posted on

Working on My First Tachiyomi Contribution

Hi everyone, if you've seen my previous blog post, you would have read about my plans to make my first two contributions to Tachiyomi. In short, I had to update the documentation of their website to state that 1 EPUB file = 1 chapter. As well as make sure that the description of a series supported Markdown, which you can find here.

Working on the Website Issue

As I mention in my planning phase, I asked a contributor where this change should be made. Well, he responded and showed me where this change should be made, which is here. So I got to work. I first, forked the repo, then cloned it to my computer. After that I opened it on VS Code and in my command line, I created a branch for this issue. I then made the documentation changes required. I ended up doing this below the part of the page where supported file formats are mentioned. After I wrote the change, I read it over to make sure it sounded right, and created a pull request. Now I just have to wait for any changes requested by the repo owner.

Working on the Android App Issue

If you remember in my previous blog post, I mentioned how for this issue I would have to learn Kotlin. Well, I did end up learning it and to be honest Kotlin, doesn't seem too hard. I actually enjoyed learning it, I like how its syntax is deferent from Java;

Java functions are created like this, private String name(), whereas Kotlin creates them like so, fun name(): String. Also, printing is different. Java is System.out.println() and Kotlin is simply println(). There is much less that you have to type with Kotlin, and I like it.

I also like that you can create extension functions in Kotlin.

After I learn Kotlin and created a few test apps modeled after code I made in my Android Java development class, I left a comment on the issue expressing my interest in working on it and which file I must work in. This prompted for the repo owner to reply and tell me where this change must be done. Which resulted in me creating a fork, cloning it, and making a branch for it. The repo owner also told me about a open source Markdown converter that they use for a similar feature in the app, which is displaying updates for their app.

I did a few test with the function, and tried my own thing. I actually managed to get the links to display on the description of the manga/comic, which meant that it was parsing the Markdown correctly. However, these links were clickable, and someone commented saying that we should make them unclickable as we shouldn't be trusting links from websites. This was something that I agreed with, and then looked at how I can remove the hyperlink. I found out that I can simply use the comment syntax <!-- --> for HTML to remove the hyperlink. All I had to do was insert the start and the end of the comment between the [ and ] of the link. I was able to do this using Regex, so I had it figured out on that end.

However, there was one problem. The Markdown function was returning null with the text, which it shouldn't be doing. I asked a question about it, and was told that I was using the function incorrectly. I then realized that I was using the wrong function altogether. I double checked the file where they use the markdown function and made this realization. So for now, I'm trying to use the function correctly, and while I see that it does parse the description, it produces a duplicate of the description. So this is something that I'll have to figure out for the next blog post.

So for now, that concludes this blog post. Thanks for reading, and I'll see in you in the next one.

Top comments (0)