一个CLI工具来可视化你的meme
memethesis的Python项目详细描述
膜促性腺激素
3.0.0-beta版更新
自动化已经达到了一个新的水平,其中all现有的格式都是完整的
由memethesizers为其各自的成分自动生成,
包括single
、vertical
和{
帮助
安装
$ cd ~ # use $HOME
$ git clone https://github.com/fakefred/memethesis-cli # will clone the git repo
$ cd memethesis-cli # will go into directory
$ python3 setup.py bdist_wheel # will generate .whl
$ pip3 install dist/memethesis* # will install the newly-created memethesis.whl created above
用法
^{pr2}$This part assumes you have a working python 3.x environment, which
python
refers to. If your OS usespython3
, you are smart enough.
新格式指南
cd
到{format.yml
。在
formats.yml
规范文档
# Keywords wrapped in <square brackets> are to be modified on demand; # others are hardcoded. Starred (*) keywords are optional. <name>: # The flag you use for the meme format # For example, if you name it 'drake' it is accessed via '-f drake' composition: vertical|horizontal|single # Denotes how the meme is made: stacked top to bottom, # laid side by side, or a single panel # Respective examples: drake, womanyelling, pigeon panels: # ^ When composition == 'single', things put here # are textboxes instead of panels, which are pasted on one panel <name>: # < Flag for this panel/textbox # For example, if you named your panel/textbox 'dislike' # it is accessed via '--dislike <text>' # Make your panel/textbox as unique as possible, # and if you can, make it short and descriptive. # IMPORTANT: flag names CAN collide. Make your flag different from # all others. description*: <description> # ^ Shown in --list and, if the composition is not single, # in --interactive image: <dir>/<image> # ^ Image path relative to ./memethesis/meme/res/template/ textbox: [370, 12, 400, 250] # ^ Textbox position, in left, top, width, height font*: notosans|notosansmono|impact|comicsans # ^ Default font for the template # (memethesis assumes notosans if none; see `fonts.py`) # Overridden when '--font' is specified in command mode style*: stroke # ^ Use 'stroke' if default font is impact for best effects <name>: # ... # ... <name>: # You can combine multiple templates into one dir, # but only do that when they're relevant and inseparable # ...
示例
下面是一个来自drake格式的测试示例:
drake: composition: vertical panels: dislike: description: Drake dislike image: drake/drake_dislike.jpg textbox: [370, 12, 400, 250] like: description: Drake like image: drake/drake_like.jpg textbox: [370, 20, 400, 250]
以下是一些要点:
- 使目录和文件与其他或潜在的目录和文件区分开来:
例如,
spiderman
作为meme格式的一个很差的标识符,因为有无数蜘蛛侠的meme。在 - 保持图像分辨率适度高。800像素宽就够了。 不要放大太多。在
- 不要在文件名和yml关键字中包含空格。在
- 除非有必要,否则使用资本。在
- 在打开一个PR之前进行测试。通过长时间的输入来确保文本框是正确的
像
'mm mm mm mm mm mm mm mm mm mm mm mm mm mm mm mm'
这样的字符串。 我会克隆你的叉子然后亲自测试。在 - 如果确保测试通过,请添加用于测试格式的命令
test.sh
在项目的根目录中。在
调试
[make edits]# to test by running module $ python -m memethesis.__main__ [args]# to test all formats with shell script $ sudo chmod +x test.sh $ ./test.sh # to test by installing wheel $ python setup.py bdist_wheel # will generate .whl $ pip install dist/memethesis-[something].whl
- 项目
标签: