You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello friend, I would like to help you with the implementation of text markup. Below I'll provide a simplified example of how you can approach this functionality in your project. Please note that this is a conceptual example.
First, here's a general approach to how you might implement the text markup functionality and save the markup:
1. User Interface:
Add an option to select and highlight text in reading view of the .jwpub file.
Add a button or option to save the markup.
2. Dialing Logic:
When text is selected and highlighted, capture the location of the markup (for example, the range of characters selected) and the content of the marked text.
Store this information in a suitable data structure, such as a JSON object.
3. Marking Storage:
You can use a separate JSON file to store the markup information.
Every time the markup is saved, it updates or adds entries to the JSON file.
4. Upload Marking:
When opening a .jwpub file for reading, it checks if there is any associated markup information in the JSON file.
If there are bookmarks stored, applies the bookmarks in reading view.
Here's a simplified example of how you might structure the code:
// En el código Kotlin (app/src/main/kotlin/...):// Almacenamiento de marcadoresval markersJsonFile =File("markers.json")
funsaveMarker(selectionRange:String, markedText:String) {
val markers = loadMarkers()
markers[selectionRange] = markedText
markersJsonFile.writeText(Json.encodeToString(markers))
}
funloadMarkers(): MutableMap<String, String> {
if (markersJsonFile.exists()) {
val markersJson = markersJsonFile.readText()
returnJson.decodeFromString(markersJson)
}
returnmutableMapOf()
}
Keep in mind that you will have to adapt it to the structure of the "Open Witness Library" project.
The text was updated successfully, but these errors were encountered:
Ooh, thank you for this! I will keep an eye on your suggestion. But there's a worry for making open witness library compatible with JW Library markups, since the backup file export markups too.
I don't know for now if I will add a new approach or try to decode the backup file approach (with seems to be very simple and optimized)
Anyway, thank you for this, I will assign a branch for this soon! 😄
Hello friend, I would like to help you with the implementation of text markup. Below I'll provide a simplified example of how you can approach this functionality in your project. Please note that this is a conceptual example.
First, here's a general approach to how you might implement the text markup functionality and save the markup:
1. User Interface:
2. Dialing Logic:
3. Marking Storage:
4. Upload Marking:
Here's a simplified example of how you might structure the code:
Keep in mind that you will have to adapt it to the structure of the "Open Witness Library" project.
The text was updated successfully, but these errors were encountered: