GithubHelp home page GithubHelp logo

newsmaker's Introduction

Compilation:

The easy way to compile the project is to use Maven with jdk 18 (you can also use the Maven integration in IntellIJ).

The command for compiling the project is:
mvn compile

and for creating the .jar (in the target directory):
mvn package

ensure that the .jar named with -shaded at the end is executable, and then it is ready to be used !

How it works:

Given an HTML base template (/assets/base.html), the software will replace all occurrence of @SECTION#LANGUAGE by all HTML formatted nodes of the given section "SECTION" "in the language "LANGUAGE".

Presets:

You can use presets to specify default values of you recurrent news fields as the name of the event, the image URL or the date. By changing the preset selection of a news field from default to another preset, the specified information will override the default's ones.

Presets can be added by modifying the config.json file. In order to add a preset to the list of presets you just need to add to the json array presets the following element, by replacing all your parameters' information, text, and URL.

{
  "sectionTag": "SECTIONNAME",
  "name": "Preset Name",
  "templateFile": "/assets/template_of_the_preset.html",
  "parameters": {
    "NEWS_DETAILS_URL": "https://url.of.website/page",
    "BACKGROUND_COLOR": "black",
    "TEXT_COLOR": "white",
    "NEWS_IMAGE_URL": "https://url/of/image",
    "NEWS_DESCRIPTION": "The description of the news",
    "NEWS_DETAIL_LABEL": "more information",
    "NEWS_TITLE": "Title of your news",
    ...
  }
}

The template file is an HTML file with the default HTML code for a news div. Part to be replaced in the HTML have to be indicated by a tag @TAG_NAME and the tag will be replaced by the corresponding text content of the tag.

In parameters section, can add all tags available in this list:

NEWS_DETAILS_URL, BACKGROUND_COLOR, TEXT_COLOR, NEWS_IMAGE_URL, NEWS_DESCRIPTION, NEWS_DETAIL_LABEL, NEWS_TITLE, NEWS_DATE

And you can also add your personal tags like SUBTITLE for exemple. In the HTML template you can identify the tags to be replaced by @YOUR_TAG_NAME (@SUBTITLE for exemple).

Don't remove the first preset default but you can modify its parameters and its template file. The parameters of the default preset are used to create a new news field, but will not override the field by changing the news field preset selection to default.

Languages:

The config.json file can be edited to change the number of languages available by adding one to the list of language.

newsmaker's People

Contributors

noeterrier avatar

Stargazers

Jarrian Gojar avatar  avatar Tugdual avatar Robb-Fr avatar

newsmaker's Issues

Hard to manage tags

It's hard to add or remove tags: we need to edit the config file, change the enum Tags in Format.java and the code in createField() in order to perform the change.

The idea is to make it dynamic: only changes in the config file update all the tags in the app.

  • We need to avoid the use of the enum Tags
  • The bindings in createField() need to be dynamic
  • Setting default values for different languages has to be possible

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.