Git Product home page Git Product logo

open-witness-library's Introduction

Open Witness Library

Open Witness Library is a program to read articles that carries God's true name.

Warning

This branch is outdated, please refer to the most recent branch.

This program is a alternative for JW Library app1 for OSes that doesn't support the app or had lost support through the years. You can read .jwpub files and study Bible.

Features

This program still is a work-in-progress, so it isn't full compatible with all publications and publication's features. You can track the features present on the program there:

  • Publications:
    • Read the publications;
    • Aswner the publication questions on textboxes;
    • Highlight publication text;
    • Make notes;
    • Watch publication's videos;
  • Bible:
    • Read Bible; You can read partially Bible's content
    • Bookmark Bible versicles and chapters;
    • Read from Publications;
    • Compare multiple Bible editions;

Installation

See Building for more information.

Building

For testing the app, you need to setup a Rust development environment on your operational system. After installing every depedency and following the prerequisites below, you should install Rustup through the official site or from your package manager and download the latest Rust language version.

Windows

For Windows, see Windows prerequisites.

MacOS

For MacOS, you will need to install CLang and MacOS development dependencies. To do this, run the following command in your terminal:

$ xcode-select --install

Linux

For Linux, you will need to install some packages in order to work, see the instruction on how to install based in your Linux distro.

WASM UI setup

After installing the depedencies, you'll need to setup Cargo for compiling the application UI and serving it locally. To do it, install Trunk via Cargo:

cargo install --locked trunk
# Until wasm-bindgen has pre-built binaries for Apple M1, 
# M1 users will need to install wasm-bindgen manually.
cargo install --locked wasm-bindgen-cli

and add wasm32-unknown-unknown target to your rustup installation:

rustup target add wasm32-unknown-unknown

Running the application

To run the application you'll need to install a last tool to cargo, the tauri-cli plugin. To install it run the following command to your terminal:

cargo install tauri-cli --version "^2.0.0-alpha"

After installing it, you can run the application with the following command:

cargo tauri dev

Running on mobile

Open Witness Library also runs on Android and iOS, but it isn't fully supported. If you want to test it out on Android, you need to add the Android targets to your rustup installation by running the following command:

rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

You will need to install Android Studio and setup it to your system.

Install the Android SDK and NDK. You can use the SDK Manager in Android Studio to install:

  1. Android SDK Platform
  2. Android SDK Platform-Tools
  3. NDK (Side by side)
  4. Android SDK Build-Tools
  5. Android SDK Command-line Tools

You will need to configure JDK too. Android Studio includes a JDK, you will just need to add it to your environment variables:

# On windows
[System.Environment]::SetEnvironmentVariable("JAVA_HOME", "C:\Program Files\Android\Android Studio\jbr", "User")
# On MacOS
export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"

# On Linux
# Note that on older Android Studio installations the 
# jbr directory may still be called jre
export JAVA_HOME=/opt/android-studio/jbr

and finally, you need to set ANDROID_HOME and NDK_HOME environment variables:

# On Windows (change NDK_VERSION to the version located in the path without brackets)
[System.Environment]::SetEnvironmentVariable("ANDROID_HOME", "$env:LocalAppData\Android\Sdk", "User")
[System.Environment]::SetEnvironmentVariable("NDK_HOME", "$env:LocalAppData\Android\Sdk\ndk\{NDK_VERSION}", "User")
# On Linux (change NDK_VERSION to the version located in the path without brackets)
export ANDROID_HOME="$HOME/Android/Sdk"
export NDK_HOME="$ANDROID_HOME/ndk/{NDK_VERSION}"

# On MacOS (change NDK_VERSION to the version located in the path without brackets)
export ANDROID_HOME="$HOME/Library/Android/sdk"
export NDK_HOME="$ANDROID_HOME/ndk/{NDK_VERSION}"

To run in Android, you can run the following command:

cargo tauri android dev

Running in iOS

You can also run on iOS, but you will need a MacOS device. I don't know if it will run since I didn't have an iOS device or a MacOS computer/laptop, but you can test it. First, make sure Xcode is properly installed. Then, you should add the iOS target to your MacOS rustup installation:

rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim

Then you can run your application on iOS with the following commmand:

cargo tauri ios dev

Contributing

Pull requests are welcome. For translations, take a look on i18n/ folder. For major changes, please open an issue first to discuss what you would like to change.

Disclaimer

This program don't have any relationship with JW Library developers or the Watch Tower Bible and Tract Society of Pennsylvania. This is a program maintened by the community. Any bug you have using this program should be issued there.

If your computer or mobile phone runs JW Library, please prefer to use the official app instead of this program.

Footnotes

  1. JW Library is a registered trademark of Watch Tower Bible and Tract Society of Pennsylvania.

open-witness-library's People

Contributors

orangethewell avatar

Stargazers

Agabo Kajabika avatar  avatar Matteo Nigro avatar  avatar Dosojin avatar Elvis Oliveira avatar Blondel MONDESIR avatar Marcelo Jacobus avatar cyan avatar  avatar

Watchers

Marcelo Jacobus avatar Dosojin avatar cyan avatar  avatar Livrädo Sandoval avatar

open-witness-library's Issues

Add Markup Functionality

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 marcadores
val markersJsonFile = File("markers.json")

fun saveMarker(selectionRange: String, markedText: String) {
    val markers = loadMarkers()
    markers[selectionRange] = markedText
    markersJsonFile.writeText(Json.encodeToString(markers))
}

fun loadMarkers(): MutableMap<String, String> {
    if (markersJsonFile.exists()) {
        val markersJson = markersJsonFile.readText()
        return Json.decodeFromString(markersJson)
    }
    return mutableMapOf()
}

Keep in mind that you will have to adapt it to the structure of the "Open Witness Library" project.

Site does not work properly

Hi brother,

This project looks great.
But I'm stumble on 1 problem. I couldn't not manage to let it work properly.

When I startup the project I only see this (see picture below), and when click on it, nothing happens.
I'm missing something? Or did I do something wrong?

Could you help me?

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.