update readme

This commit is contained in:
Torsten 2022-12-30 14:25:21 +02:00
parent 02c202fcd3
commit 0cab5f5523

View File

@ -47,28 +47,33 @@ Like a Page, a Section may have options.
### Cards ### Cards
Cards, as in general css lingo, are usually smaller html snippets, Cards, as in general css lingo, are usually smaller html boxes,
usually contained in a grid (defined by the Section). usually contained in a grid (defined by the Section). But they may
be form fields, or features (svg).
Cards have data and options like the other elements. Cards have data and options like the other elements.
### Image ### Image
Merged also manages images, adding deleting, renaming, which are Merged also manages images, adding deleting, renaming, even a small editor.
stored in the assets folder. With the Pages (and their data) they Images are stored in the assets folder. With the Pages, Sections and Cards they
define the content that users can change. define the content that users can change.
Images merge into the upstream in the same way as the pages, through Images merge into the upstream in the same way as the pages, through
git actions (partially done by Merged) git actions (partially done by Merged)
## Change (-sets) ### Change (-sets)
As data is in files, all change happens by git. As data is in files, all change happens by git.
Merged partially manages this, by making changes visible to the Merged partially manages this, by making changes visible to the
users, ie what Pages and Images were added/removed or edited. users, ie what Pages and Images were added/removed or edited.
Merged can commit and in the future maybe even push. Merged can commit and in the future maybe even push.
### Basic setup Merged requires a user to be logged in and will log all changes, meaning
change times and the email of the editor. The last change is displayed in
the ui for auditing purposes.
## Basic setup
A developer set up a machine on a intranet/lan. Ie access is A developer set up a machine on a intranet/lan. Ie access is
restricted by physical access. restricted by physical access.
@ -78,12 +83,12 @@ A User may use the machine to edit and commit and push (the branch).
The developer reviews, merges changes and deploys. The developer reviews, merges changes and deploys.
## Installation ## Installation
Add this line to your application's Gemfile: Add this line to your application's Gemfile:
```ruby ```ruby
gem "merged" gem "merged" , git: "https://github.com/HubFeenixMakers/merged"
``` ```
And then execute: And then execute:
@ -91,7 +96,8 @@ And then execute:
$ bundle $ bundle
``` ```
Mount engine in routes for editing. Mount engine in routes for editing (possibly not in production).
```ruby ```ruby
mount Merged::Engine => "/merged" mount Merged::Engine => "/merged"
``` ```
@ -106,25 +112,69 @@ If Merged served the root:
root "merged/view#view" , id: 'index' root "merged/view#view" , id: 'index'
``` ```
Include merged stylesheet to your layout (NOT asset ### Stylesheets
pipeline).
#### Apps not using tailwind
Include merged stylesheet to your layout or asset
pipeline.
``` ```
= stylesheet_link_tag "application" = stylesheet_link_tag "application"
= stylesheet_link_tag "merged/merged" = stylesheet_link_tag "merged/merged"
= stylesheet_link_tag "tailwind" , "inter-font", "data-turbo-track": "reload"
``` ```
If you use tailwind with the basic install, add it _before_ tailwind, #### Apps using tailwind
and switch preflight off in the apps tailwind config file (config/tailwind.config.js). Otherwise tailwind will reset the styles from merged
or the other way around. If you use tailwind with the basic install, you need to edit the tailwind config.
Basically it is impossible to have two tailwind generated stylesheets, so your app needs to pick
up the merged styles. This can be configured like so:
``` ```
corePlugins: { const output = execSync('bundle show merged', { encoding: 'utf-8' });
preflight: false, const fullname = output.trim() + '/app/**/*.{haml,html,rb}' ;
}
module.exports = {
content: [
fullname ,
.... as before
]
``` ```
## Developers
### Styles
Developers should look at the predefined styles. These are found in
merged gem /config/merged/**style.yml
And on a running app http://localhost:3000/merged/styles/index
### Section Views
These are under app/views/merged/views/sections/*haml
and the name of the file matches the section_style entry
Developers may define more section styles, but must provide the partials to render them.
### Card Views
These are under app/views/merged/views/cards/*haml
and the name of the file matches the card entry.
Developers may define more card styles, but must provide the partials to render them.
### Options
Option definitions (also found under style dir) are common between elements.
Options may be added and then used in the view partials. Many common ones (background,
color) and many more are already defined.
To make the partials more dry, Helpers are defined in OptionsHelper
## Contributing ## Contributing
Ask first. Ask first.