Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jeff
pleroma
Commits
31cff7db
Commit
31cff7db
authored
6 years ago
by
vaartis
Browse files
Options
Downloads
Patches
Plain Diff
Document the pleroma.emoji task
parent
1e311d66
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/config/custom_emoji.md
+15
-5
15 additions, 5 deletions
docs/config/custom_emoji.md
lib/mix/tasks/pleroma/emoji.ex
+43
-1
43 additions, 1 deletion
lib/mix/tasks/pleroma/emoji.ex
with
58 additions
and
6 deletions
docs/config/custom_emoji.md
+
15
−
5
View file @
31cff7db
# Custom Emoji
Before you add your own custom emoji, check if they are available in an existing pack.
See
`Mix.Tasks.Pleroma.Emoji`
for information about emoji packs.
To add custom emoji:
*
Add the image file(s) to
`priv/static/emoji/custom`
*
In case of conflicts: add the desired shortcode with the path to
`config/custom_emoji.txt`
, comma-separated and one per line
*
Force recompilation (
``mix clean && mix compile``
)
*
Create the
`STATIC-DIR/emoji/`
directory if it doesn't exist
(
`STATIC-DIR`
is configurable,
`instance/static/`
by default)
*
Create a directory with whatever name you want (custom is a good name to show the purpose of it).
This will create a local emoji pack.
*
Put your
`.png`
emoji files in that directory. In case of conflicts, you can create an
`emoji.txt`
file in that directory and specify a custom shortcode using the following format:
`shortcode, file-path, tag1, tag2, etc`
. One emoji per line. Note that if you do so,
you'll have to list all other emojis in the pack too.
*
Either restart pleroma or connect to the iex session pleroma's running and
run
`Pleroma.Emoji.reload/0`
in it.
Example:
image files (in
`
/priv
/static/emoji/custom`
):
`happy.png`
and
`sad.png`
image files (in
`
instance
/static/emoji/custom`
):
`happy.png`
and
`sad.png`
content of
`
config/custom_
emoji.txt`
:
content of
`emoji.txt`
:
```
happy, /emoji/custom/happy.png, Tag1,Tag2
sad, /emoji/custom/sad.png, Tag1
...
...
This diff is collapsed.
Click to expand it.
lib/mix/tasks/pleroma/emoji.ex
+
43
−
1
View file @
31cff7db
...
...
@@ -5,8 +5,50 @@
defmodule
Mix
.
Tasks
.
Pleroma
.
Emoji
do
use
Mix
.
Task
@shortdoc
"Manages
Pleroma instance
"
@shortdoc
"Manages
emoji packs
"
@moduledoc
"""
Manages emoji packs
## ls-packs
mix pleroma.emoji ls-packs [OPTION...]
Lists the emoji packs and metadata specified in the manifest.
### Options
- `-m, --manifest PATH/URL` - path to a custom manifest, it can either be an URL
starting with `http`, in that case the manifest will be fetched from that address,
or a local path
## get-packs
mix pleroma.emoji get-packs [OPTION...] PACKS
Fetches, verifies and installs the specified PACKS from the manifest into
the `STATIC-DIR/emoji/PACK-NAME
### Options
- `-m, --manifest PATH/URL` - same as ls-packs
## gen-pack
mix pleroma.emoji gen-pack PACK-URL
Creates a new manifest entry and a file list from the specified remote pack file.
Currently, only .zip archives are recognized as remote pack files and packs are therefore
assumed to be zip archives. This command is intended to run interactively and
will first ask you some basic questions about the pack, then download the remote
file and generate an MD5 signature for it, then generate an emoji file list for you.
The manifest entry will either be written to a newly created `index.json` file or appended to the existing one,
*replacing* the old pack with the same name if it was in the file previously.
The file list will be written to the file specified previously, *replacing* that file.
You _should_ check that the file list doesn't contain anything you don't need in the pack, that is,
anything that is not an emoji (the whole pack is downloaded, but only emoji files are extracted).
"""
@default_manifest
Pleroma
.
Config
.
get!
([
:emoji
,
:default_manifest
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment