diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..e51c1d18 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,7 @@ +all: install + pipenv run mkdocs build + +install: + pipenv install +clean: + rm -rf site diff --git a/docs/Pipfile b/docs/Pipfile new file mode 100644 index 00000000..3e538a54 --- /dev/null +++ b/docs/Pipfile @@ -0,0 +1,10 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] + +[packages] +mkdocs-material = "*" +markdown-include = "*" diff --git a/docs/Pipfile.lock b/docs/Pipfile.lock new file mode 100644 index 00000000..ae39a277 --- /dev/null +++ b/docs/Pipfile.lock @@ -0,0 +1,277 @@ +{ + "_meta": { + "hash": { + "sha256": "926d34630c729228bb015cb958c04f8269c57f5ca1ffc2ceab1dfd1798884772" + }, + "pipfile-spec": 6, + "requires": {}, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "click": { + "hashes": [ + "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e", + "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48" + ], + "markers": "python_version >= '3.7'", + "version": "==8.1.3" + }, + "ghp-import": { + "hashes": [ + "sha256:8337dd7b50877f163d4c0289bc1f1c7f127550241988d568c1db512c4324a619", + "sha256:9c535c4c61193c2df8871222567d7fd7e5014d835f97dc7b7439069e2413d343" + ], + "version": "==2.1.0" + }, + "importlib-metadata": { + "hashes": [ + "sha256:637245b8bab2b6502fcbc752cc4b7a6f6243bb02b31c5c26156ad103d3d45670", + "sha256:7401a975809ea1fdc658c3aa4f78cc2195a0e019c5cbc4c06122884e9ae80c23" + ], + "markers": "python_version >= '3.7'", + "version": "==4.12.0" + }, + "jinja2": { + "hashes": [ + "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852", + "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61" + ], + "markers": "python_version >= '3.7'", + "version": "==3.1.2" + }, + "markdown": { + "hashes": [ + "sha256:cbb516f16218e643d8e0a95b309f77eb118cb138d39a4f27851e6a63581db874", + "sha256:f5da449a6e1c989a4cea2631aa8ee67caa5a2ef855d551c88f9e309f4634c621" + ], + "markers": "python_version >= '3.6'", + "version": "==3.3.7" + }, + "markdown-include": { + "hashes": [ + "sha256:6f5d680e36f7780c7f0f61dca53ca581bd50d1b56137ddcd6353efafa0c3e4a2" + ], + "index": "pypi", + "version": "==0.6.0" + }, + "markupsafe": { + "hashes": [ + "sha256:0212a68688482dc52b2d45013df70d169f542b7394fc744c02a57374a4207003", + "sha256:089cf3dbf0cd6c100f02945abeb18484bd1ee57a079aefd52cffd17fba910b88", + "sha256:10c1bfff05d95783da83491be968e8fe789263689c02724e0c691933c52994f5", + "sha256:33b74d289bd2f5e527beadcaa3f401e0df0a89927c1559c8566c066fa4248ab7", + "sha256:3799351e2336dc91ea70b034983ee71cf2f9533cdff7c14c90ea126bfd95d65a", + "sha256:3ce11ee3f23f79dbd06fb3d63e2f6af7b12db1d46932fe7bd8afa259a5996603", + "sha256:421be9fbf0ffe9ffd7a378aafebbf6f4602d564d34be190fc19a193232fd12b1", + "sha256:43093fb83d8343aac0b1baa75516da6092f58f41200907ef92448ecab8825135", + "sha256:46d00d6cfecdde84d40e572d63735ef81423ad31184100411e6e3388d405e247", + "sha256:4a33dea2b688b3190ee12bd7cfa29d39c9ed176bda40bfa11099a3ce5d3a7ac6", + "sha256:4b9fe39a2ccc108a4accc2676e77da025ce383c108593d65cc909add5c3bd601", + "sha256:56442863ed2b06d19c37f94d999035e15ee982988920e12a5b4ba29b62ad1f77", + "sha256:671cd1187ed5e62818414afe79ed29da836dde67166a9fac6d435873c44fdd02", + "sha256:694deca8d702d5db21ec83983ce0bb4b26a578e71fbdbd4fdcd387daa90e4d5e", + "sha256:6a074d34ee7a5ce3effbc526b7083ec9731bb3cbf921bbe1d3005d4d2bdb3a63", + "sha256:6d0072fea50feec76a4c418096652f2c3238eaa014b2f94aeb1d56a66b41403f", + "sha256:6fbf47b5d3728c6aea2abb0589b5d30459e369baa772e0f37a0320185e87c980", + "sha256:7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b", + "sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812", + "sha256:8dc1c72a69aa7e082593c4a203dcf94ddb74bb5c8a731e4e1eb68d031e8498ff", + "sha256:8e3dcf21f367459434c18e71b2a9532d96547aef8a871872a5bd69a715c15f96", + "sha256:8e576a51ad59e4bfaac456023a78f6b5e6e7651dcd383bcc3e18d06f9b55d6d1", + "sha256:96e37a3dc86e80bf81758c152fe66dbf60ed5eca3d26305edf01892257049925", + "sha256:97a68e6ada378df82bc9f16b800ab77cbf4b2fada0081794318520138c088e4a", + "sha256:99a2a507ed3ac881b975a2976d59f38c19386d128e7a9a18b7df6fff1fd4c1d6", + "sha256:a49907dd8420c5685cfa064a1335b6754b74541bbb3706c259c02ed65b644b3e", + "sha256:b09bf97215625a311f669476f44b8b318b075847b49316d3e28c08e41a7a573f", + "sha256:b7bd98b796e2b6553da7225aeb61f447f80a1ca64f41d83612e6139ca5213aa4", + "sha256:b87db4360013327109564f0e591bd2a3b318547bcef31b468a92ee504d07ae4f", + "sha256:bcb3ed405ed3222f9904899563d6fc492ff75cce56cba05e32eff40e6acbeaa3", + "sha256:d4306c36ca495956b6d568d276ac11fdd9c30a36f1b6eb928070dc5360b22e1c", + "sha256:d5ee4f386140395a2c818d149221149c54849dfcfcb9f1debfe07a8b8bd63f9a", + "sha256:dda30ba7e87fbbb7eab1ec9f58678558fd9a6b8b853530e176eabd064da81417", + "sha256:e04e26803c9c3851c931eac40c695602c6295b8d432cbe78609649ad9bd2da8a", + "sha256:e1c0b87e09fa55a220f058d1d49d3fb8df88fbfab58558f1198e08c1e1de842a", + "sha256:e72591e9ecd94d7feb70c1cbd7be7b3ebea3f548870aa91e2732960fa4d57a37", + "sha256:e8c843bbcda3a2f1e3c2ab25913c80a3c5376cd00c6e8c4a86a89a28c8dc5452", + "sha256:efc1913fd2ca4f334418481c7e595c00aad186563bbc1ec76067848c7ca0a933", + "sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a", + "sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7" + ], + "markers": "python_version >= '3.7'", + "version": "==2.1.1" + }, + "mergedeep": { + "hashes": [ + "sha256:0096d52e9dad9939c3d975a774666af186eda617e6ca84df4c94dec30004f2a8", + "sha256:70775750742b25c0d8f36c55aed03d24c3384d17c951b3175d898bd778ef0307" + ], + "markers": "python_version >= '3.6'", + "version": "==1.3.4" + }, + "mkdocs": { + "hashes": [ + "sha256:26bd2b03d739ac57a3e6eed0b7bcc86168703b719c27b99ad6ca91dc439aacde", + "sha256:b504405b04da38795fec9b2e5e28f6aa3a73bb0960cb6d5d27ead28952bd35ea" + ], + "markers": "python_version >= '3.6'", + "version": "==1.3.0" + }, + "mkdocs-material": { + "hashes": [ + "sha256:263f2721f3abe533b61f7c8bed435a0462620912742c919821ac2d698b4bfe67", + "sha256:dc82b667d2a83f0de581b46a6d0949732ab77e7638b87ea35b770b33bc02e75a" + ], + "index": "pypi", + "version": "==8.3.9" + }, + "mkdocs-material-extensions": { + "hashes": [ + "sha256:a82b70e533ce060b2a5d9eb2bc2e1be201cf61f901f93704b4acf6e3d5983a44", + "sha256:bfd24dfdef7b41c312ede42648f9eb83476ea168ec163b613f9abd12bbfddba2" + ], + "markers": "python_version >= '3.6'", + "version": "==1.0.3" + }, + "packaging": { + "hashes": [ + "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb", + "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522" + ], + "markers": "python_version >= '3.6'", + "version": "==21.3" + }, + "pygments": { + "hashes": [ + "sha256:5eb116118f9612ff1ee89ac96437bb6b49e8f04d8a13b514ba26f620208e26eb", + "sha256:dc9c10fb40944260f6ed4c688ece0cd2048414940f1cea51b8b226318411c519" + ], + "markers": "python_version >= '3.6'", + "version": "==2.12.0" + }, + "pymdown-extensions": { + "hashes": [ + "sha256:3ef2d998c0d5fa7eb09291926d90d69391283561cf6306f85cd588a5eb5befa0", + "sha256:ec141c0f4983755349f0c8710416348d1a13753976c028186ed14f190c8061c4" + ], + "markers": "python_version >= '3.7'", + "version": "==9.5" + }, + "pyparsing": { + "hashes": [ + "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb", + "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc" + ], + "markers": "python_full_version >= '3.6.8'", + "version": "==3.0.9" + }, + "python-dateutil": { + "hashes": [ + "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86", + "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==2.8.2" + }, + "pyyaml": { + "hashes": [ + "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293", + "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b", + "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57", + "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b", + "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4", + "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07", + "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba", + "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9", + "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287", + "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513", + "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0", + "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0", + "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92", + "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f", + "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2", + "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc", + "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c", + "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86", + "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4", + "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c", + "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34", + "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b", + "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c", + "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb", + "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737", + "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3", + "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d", + "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53", + "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78", + "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803", + "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a", + "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174", + "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5" + ], + "markers": "python_version >= '3.6'", + "version": "==6.0" + }, + "pyyaml-env-tag": { + "hashes": [ + "sha256:70092675bda14fdec33b31ba77e7543de9ddc88f2e5b99160396572d11525bdb", + "sha256:af31106dec8a4d68c60207c1886031cbf839b68aa7abccdb19868200532c2069" + ], + "markers": "python_version >= '3.6'", + "version": "==0.1" + }, + "six": { + "hashes": [ + "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", + "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==1.16.0" + }, + "watchdog": { + "hashes": [ + "sha256:083171652584e1b8829581f965b9b7723ca5f9a2cd7e20271edf264cfd7c1412", + "sha256:117ffc6ec261639a0209a3252546b12800670d4bf5f84fbd355957a0595fe654", + "sha256:186f6c55abc5e03872ae14c2f294a153ec7292f807af99f57611acc8caa75306", + "sha256:195fc70c6e41237362ba720e9aaf394f8178bfc7fa68207f112d108edef1af33", + "sha256:226b3c6c468ce72051a4c15a4cc2ef317c32590d82ba0b330403cafd98a62cfd", + "sha256:247dcf1df956daa24828bfea5a138d0e7a7c98b1a47cf1fa5b0c3c16241fcbb7", + "sha256:255bb5758f7e89b1a13c05a5bceccec2219f8995a3a4c4d6968fe1de6a3b2892", + "sha256:43ce20ebb36a51f21fa376f76d1d4692452b2527ccd601950d69ed36b9e21609", + "sha256:4f4e1c4aa54fb86316a62a87b3378c025e228178d55481d30d857c6c438897d6", + "sha256:5952135968519e2447a01875a6f5fc8c03190b24d14ee52b0f4b1682259520b1", + "sha256:64a27aed691408a6abd83394b38503e8176f69031ca25d64131d8d640a307591", + "sha256:6b17d302850c8d412784d9246cfe8d7e3af6bcd45f958abb2d08a6f8bedf695d", + "sha256:70af927aa1613ded6a68089a9262a009fbdf819f46d09c1a908d4b36e1ba2b2d", + "sha256:7a833211f49143c3d336729b0020ffd1274078e94b0ae42e22f596999f50279c", + "sha256:8250546a98388cbc00c3ee3cc5cf96799b5a595270dfcfa855491a64b86ef8c3", + "sha256:97f9752208f5154e9e7b76acc8c4f5a58801b338de2af14e7e181ee3b28a5d39", + "sha256:9f05a5f7c12452f6a27203f76779ae3f46fa30f1dd833037ea8cbc2887c60213", + "sha256:a735a990a1095f75ca4f36ea2ef2752c99e6ee997c46b0de507ba40a09bf7330", + "sha256:ad576a565260d8f99d97f2e64b0f97a48228317095908568a9d5c786c829d428", + "sha256:b530ae007a5f5d50b7fbba96634c7ee21abec70dc3e7f0233339c81943848dc1", + "sha256:bfc4d351e6348d6ec51df007432e6fe80adb53fd41183716017026af03427846", + "sha256:d3dda00aca282b26194bdd0adec21e4c21e916956d972369359ba63ade616153", + "sha256:d9820fe47c20c13e3c9dd544d3706a2a26c02b2b43c993b62fcd8011bcc0adb3", + "sha256:ed80a1628cee19f5cfc6bb74e173f1b4189eb532e705e2a13e3250312a62e0c9", + "sha256:ee3e38a6cc050a8830089f79cbec8a3878ec2fe5160cdb2dc8ccb6def8552658" + ], + "markers": "python_version >= '3.6'", + "version": "==2.1.9" + }, + "zipp": { + "hashes": [ + "sha256:56bf8aadb83c24db6c4b577e13de374ccfb67da2078beba1d037c17980bf43ad", + "sha256:c4f6e5bbf48e74f7a38e7cc5b0480ff42b0ae5178957d564d18932525d5cf099" + ], + "markers": "python_version >= '3.7'", + "version": "==3.8.0" + } + }, + "develop": {} +} diff --git a/docs/CONFIGURATION.md b/docs/docs/CONFIGURATION.md similarity index 95% rename from docs/CONFIGURATION.md rename to docs/docs/CONFIGURATION.md index dfc5f9dc..cdcbc61a 100644 --- a/docs/CONFIGURATION.md +++ b/docs/docs/CONFIGURATION.md @@ -7,9 +7,9 @@ PleromaFE gets its configuration from several sources, in order of preference (the one above overrides ones below it) -1. `/api/statusnet/config.json` - this is generated on Backend and contains multiple things including instance name, char limit etc. It also contains FE/Client-specific data, PleromaFE uses `pleromafe` field of it. For more info on changing config on BE, look [here](../backend/configuration/cheatsheet.md#frontend_configurations) -2. `/static/config.json` - this is a static FE-provided file, containing only FE specific configuration. This file is completely optional and could be removed but is useful as a fallback if some configuration JSON property isn't present in BE-provided config. It's also a reference point to check what default configuration are and what JSON properties even exist. In local dev mode it could be used to override BE configuration, more about that in HACKING.md. File is located [here](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/static/config.json). -3. Built-in defaults. Those are hard-coded defaults that are used when `/static/config.json` is not available and BE-provided configuration JSON is missing some JSON properties. ( [Code](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/src/modules/instance.js) ) +1. `/api/statusnet/config.json` - this is generated on Backend and contains multiple things including instance name, char limit etc. It also contains FE/Client-specific data, PleromaFE uses `pleromafe` field of it. For more info on changing config on BE, look [here](https://docs.akkoma.dev/stable/configuration/cheatsheet.md#frontend_configurations) +2. `/static/config.json` - this is a static FE-provided file, containing only FE specific configuration. This file is completely optional and could be removed but is useful as a fallback if some configuration JSON property isn't present in BE-provided config. It's also a reference point to check what default configuration are and what JSON properties even exist. In local dev mode it could be used to override BE configuration, more about that in HACKING.md. File is located [here](https://akkoma.dev/AkkomaGang/pleroma-fe/src/branch/develop/static/config.json). +3. Built-in defaults. Those are hard-coded defaults that are used when `/static/config.json` is not available and BE-provided configuration JSON is missing some JSON properties. ( [Code](https://akkoma.dev/AkkomaGang/pleroma-fe/src/branch/develop/src/modules/instance.js) ) ## Instance-defaults diff --git a/docs/HACKING.md b/docs/docs/HACKING.md similarity index 90% rename from docs/HACKING.md rename to docs/docs/HACKING.md index 7f2964b4..4cabb9bf 100644 --- a/docs/HACKING.md +++ b/docs/docs/HACKING.md @@ -25,7 +25,7 @@ This could be a bit trickier, you basically need steps 1-4 from *develop build* ### Replacing your instance's frontend with custom FE build -This is the most easiest way to use and test FE build: you just need to copy or symlink contents of `dist` folder into backend's [static directory](../backend/configuration/static_dir.md), by default it is located in `instance/static`, or in `/var/lib/pleroma/static` for OTP release installations, create it if it doesn't exist already. Be aware that running `yarn build` wipes the contents of `dist` folder. +This is the most easiest way to use and test FE build: you just need to copy or symlink contents of `dist` folder into backend's [static directory](https://docs.akkoma.dev/stable/configuration/static_dir/), by default it is located in `instance/static`, or in `/var/lib/pleroma/static` for OTP release installations, create it if it doesn't exist already. Be aware that running `yarn build` wipes the contents of `dist` folder. ### Running production build locally or on a separate server @@ -67,7 +67,7 @@ server { ### API, Data, Operations -In 99% cases PleromaFE uses [MastoAPI](https://docs.joinmastodon.org/api/) with [Pleroma Extensions](../backend/API/differences_in_mastoapi_responses.md) to fetch the data. The rest is either QvitterAPI leftovers or pleroma-exclusive APIs. QvitterAPI doesn't exactly have documentation and uses different JSON structure and sometimes different parameters and workflows, [this](https://twitter-api.readthedocs.io/en/latest/index.html) could be a good reference though. Some pleroma-exclusive API may still be using QvitterAPI JSON structure. +In 99% cases PleromaFE uses [MastoAPI](https://docs.joinmastodon.org/api/) with [Pleroma Extensions](https://docs.akkoma.dev/stable/differences_in_mastoapi_responses.md) to fetch the data. The rest is either QvitterAPI leftovers or pleroma-exclusive APIs. QvitterAPI doesn't exactly have documentation and uses different JSON structure and sometimes different parameters and workflows, [this](https://twitter-api.readthedocs.io/en/latest/index.html) could be a good reference though. Some pleroma-exclusive API may still be using QvitterAPI JSON structure. PleromaFE supports both formats by transforming them into internal format which is basically QvitterAPI one with some additions and renaming. All data is passed trough [Entity Normalizer](https://git.pleroma.social/pleroma/pleroma-fe/-/blob/develop/src/services/entity_normalizer/entity_normalizer.service.js) which can serve as a reference of API and what's actually used, it's also a host for all the hacks and data transformation. diff --git a/docs/assets/example_emoji.png b/docs/docs/assets/example_emoji.png similarity index 100% rename from docs/assets/example_emoji.png rename to docs/docs/assets/example_emoji.png diff --git a/docs/assets/example_markdown.png b/docs/docs/assets/example_markdown.png similarity index 100% rename from docs/assets/example_markdown.png rename to docs/docs/assets/example_markdown.png diff --git a/docs/docs/css/extra.css b/docs/docs/css/extra.css new file mode 100644 index 00000000..b5ceb8a8 --- /dev/null +++ b/docs/docs/css/extra.css @@ -0,0 +1,28 @@ +p, a, li, pre { + font-family: "Tiresias PCFont", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important; +} + +code, +.codehilite pre { + font-weight: bold; +} + +:root > * { + --md-primary-fg-color: #593196; + --md-accent-fg-color: #455a63; +} + +@font-face { + font-family: 'Tiresias PCFont'; + font-style: normal; + font-weight: 400; + src: local('Tiresias PCFont'), local('Tiresias PCFont'), + url('./fonts/Tiresias_PCfont.ttf') format('truetype') +} +@font-face { + font-family: 'Tiresias Infofont'; + font-style: normal; + font-weight: 400; + src: local('Tiresias Infofont'), local('Tiresias Infofont'), + url('./fonts/Tiresias_Infofont.ttf') format('truetype') +} diff --git a/docs/docs/fonts/Tiresias_Infofont.ttf b/docs/docs/fonts/Tiresias_Infofont.ttf new file mode 100755 index 00000000..2a8a6aaa Binary files /dev/null and b/docs/docs/fonts/Tiresias_Infofont.ttf differ diff --git a/docs/docs/fonts/Tiresias_PCfont.ttf b/docs/docs/fonts/Tiresias_PCfont.ttf new file mode 100755 index 00000000..c85364e9 Binary files /dev/null and b/docs/docs/fonts/Tiresias_PCfont.ttf differ diff --git a/docs/docs/images/pleroma_logo_vector_bg_32.png b/docs/docs/images/pleroma_logo_vector_bg_32.png new file mode 100644 index 00000000..7cebcfd7 Binary files /dev/null and b/docs/docs/images/pleroma_logo_vector_bg_32.png differ diff --git a/docs/docs/images/pleroma_logo_vector_nobg.svg b/docs/docs/images/pleroma_logo_vector_nobg.svg new file mode 100644 index 00000000..6dd80260 --- /dev/null +++ b/docs/docs/images/pleroma_logo_vector_nobg.svg @@ -0,0 +1,92 @@ + + + + diff --git a/docs/index.md b/docs/docs/index.md similarity index 100% rename from docs/index.md rename to docs/docs/index.md diff --git a/docs/user_guide/index.md b/docs/docs/user_guide/index.md similarity index 100% rename from docs/user_guide/index.md rename to docs/docs/user_guide/index.md diff --git a/docs/user_guide/posting_reading_basic_functions.md b/docs/docs/user_guide/posting_reading_basic_functions.md similarity index 100% rename from docs/user_guide/posting_reading_basic_functions.md rename to docs/docs/user_guide/posting_reading_basic_functions.md diff --git a/docs/user_guide/settings.md b/docs/docs/user_guide/settings.md similarity index 100% rename from docs/user_guide/settings.md rename to docs/docs/user_guide/settings.md diff --git a/docs/user_guide/timelines.md b/docs/docs/user_guide/timelines.md similarity index 100% rename from docs/user_guide/timelines.md rename to docs/docs/user_guide/timelines.md diff --git a/docs/user_guide/users_follow_mute_block.md b/docs/docs/user_guide/users_follow_mute_block.md similarity index 100% rename from docs/user_guide/users_follow_mute_block.md rename to docs/docs/user_guide/users_follow_mute_block.md diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 00000000..73fca986 --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,37 @@ +site_name: Pleroma-FE Documentation +theme: + favicon: 'images/pleroma_logo_vector_bg_32.png' + name: 'material' + custom_dir: 'theme' + # Disable google fonts + font: false + logo: 'images/pleroma_logo_vector_nobg.svg' + features: + - tabs + palette: + primary: 'deep purple' + accent: 'blue grey' + +extra_css: + - css/extra.css +repo_name: 'AkkomaGang/pleroma-fe' +repo_url: 'https://akkoma.dev/AkkomaGang/pleroma-fe' + +extra: + repo_icon: gitea + +markdown_extensions: + # Note/warning blocks https://squidfunk.github.io/mkdocs-material/extensions/admonition/ + - admonition + - codehilite: + guess_lang: false + # Make it possible to link to every header https://squidfunk.github.io/mkdocs-material/extensions/permalinks/ + - toc: + permalink: true + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.superfences + - pymdownx.tabbed + - pymdownx.details + - markdown_include.include: + base_path: docs diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..70fbd9dc --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,22 @@ +click==8.1.3 +ghp-import==2.1.0 +importlib-metadata==4.12.0 +Jinja2==3.1.2 +Markdown==3.3.7 +markdown-include==0.6.0 +MarkupSafe==2.1.1 +mergedeep==1.3.4 +mkdocs==1.3.0 +mkdocs-bootswatch==1.1 +mkdocs-material==8.1.8 +mkdocs-material-extensions==1.0.3 +packaging==21.3 +Pygments==2.11.2 +pymdown-extensions==9.1 +pyparsing==3.0.9 +python-dateutil==2.8.2 +PyYAML==6.0 +pyyaml_env_tag==0.1 +six==1.16.0 +watchdog==2.1.9 +zipp==3.8.0 diff --git a/docs/site/404.html b/docs/site/404.html new file mode 100644 index 00000000..72b37321 --- /dev/null +++ b/docs/site/404.html @@ -0,0 +1,479 @@ + + + +
+ + + + + + + + + + + +PleromaFE gets its configuration from several sources, in order of preference (the one above overrides ones below it)
+/api/statusnet/config.json
- this is generated on Backend and contains multiple things including instance name, char limit etc. It also contains FE/Client-specific data, PleromaFE uses pleromafe
field of it. For more info on changing config on BE, look here/static/config.json
- this is a static FE-provided file, containing only FE specific configuration. This file is completely optional and could be removed but is useful as a fallback if some configuration JSON property isn't present in BE-provided config. It's also a reference point to check what default configuration are and what JSON properties even exist. In local dev mode it could be used to override BE configuration, more about that in HACKING.md. File is located here./static/config.json
is not available and BE-provided configuration JSON is missing some JSON properties. ( Code )Important note that some configurations are treated as "instance default" - it means user is able to change this configuration for themselves. Currently, defaults are only applied for new visitors and people who haven't changed the option in question. If you change some instance default option, there is a chance it won't affect some users.
+There's currently no mechanism for user-settings synchronization across several browsers, user essentially means visitor, most user settings are stored in local storage/IndexedDB and not tied to an account in any way.
+alwaysShowSubjectInput
¶true
- will always show subject line input, false
- only show when it's not empty (i.e. replying). To hide subject line input completely, set it to false
and subjectLineBehavior
to "noop"
background
¶Default image background. Be aware of using too big images as they may take longer to load. Currently image is fitted with background-size: cover
which means "scaled and cropped", currently left-aligned. De-facto instance default, user can choose their own background, if they remove their own background, instance default will be used instead.
collapseMessageWithSubject
¶Collapse post content when post has a subject line (content warning). Instance-default.
+disableChat
¶hides the chat (TODO: even if it's enabled on backend)
+greentext
¶Changes lines prefixed with the >
character to have a green text color
hideFilteredStatuses
¶Removes filtered statuses from timelines.
+hideMutedPosts
¶Removes muted statuses from timelines.
+hidePostStats
¶Hide repeats/favorites counters for posts.
+hideSitename
¶Hide instance name in header.
+hideUserStats
¶Hide followers/friends counters for users.
+loginMethod
¶"password"
- show simple password field
+"token"
- show button to log in with external method (will redirect to login form, more details in BE documentation)
logo
, logoMask
, logoMargin
¶Instance logo
, could be any image, including svg. By default it assumes logo used will be monochrome-with-alpha one, this is done to be compatible with both light and dark themes, so that white logo designed with dark theme in mind won't be invisible over light theme, this is done via CSS3 Masking. Basically - it will take alpha channel of the image and fill non-transparent areas of it with solid color. If you really want colorful logo - it can be done by setting logoMask
to false
.
logoMargin
allows you to adjust vertical margins between logo boundary and navbar borders. The idea is that to have logo's image without any extra margins and instead adjust them to your need in layout.
minimalScopesMode
¶Limit scope selection to Direct, User default and Scope of post replying to. This also makes it impossible to reply to a DM with a non-DM post from PleromaFE.
+nsfwCensorImage
¶Use custom image for NSFW'd images
+postContentType
¶Default post formatting option (markdown/bbcode/plaintext/etc...)
+redirectRootNoLogin
, redirectRootLogin
¶These two settings should point to where FE should redirect visitor when they login/open up website root
+scopeCopy
¶Copy post scope (visibility) when replying to a post. Instance-default.
+sidebarRight
¶Change alignment of sidebar and panels to the right. Defaults to false
.
showFeaturesPanel
¶Show panel showcasing instance features/settings to logged-out visitors
+showInstanceSpecificPanel
¶This allows you to include arbitrary HTML content in a panel below navigation menu. PleromaFE looks for an html page instance/panel.html
, by default it's not provided in FE, but BE bundles some default one. De-facto instance-defaults, since user can hide instance-specific panel.
subjectLineBehavior
¶How to handle subject line (CW) when replying to a post.
+* "email"
- like EMail - prepend re:
to subject line if it doesn't already start with it.
+* "masto"
- like Mastodon - copy it as is.
+* "noop"
- do not copy
+Instance-default.
theme
¶Default theme used for new users. De-facto instance-default, user can change theme.
+webPushNotifications
¶Enables PushAPI - based notifications for users. Instance-default.
+Some features are configured depending on how backend is configured. In general the approach is "if backend allows it there's no need to hide it, if backend doesn't allow it there's no need to show it.
+TODO somewhat broken, see: disableChat chat can be disabled by disabling it in backend
+If the private
instance setting is enabled in the backend, features that are not accessible without authentication, such as the timelines and search will be disabled for unauthenticated users.
Rich text formatting options are displayed depending on how many formatting options are enabled on backend, if you don't want your users to use rich text at all you can only allow "text/plain" one, frontend then will only display post text format as a label instead of dropdown (just so that users know for example if you only allow Markdown, only BBCode or only Plain text)
+This is a panel intended for users to find people to follow based on randomness or on post contents. Being potentially privacy unfriendly feature it needs to be enabled and configured in backend to be enabled.
+ + +PleromaFE is an SPA (Single-Page Application) backed by Vue framework. It means that it's just a nearly-empty HTML page with bunch of JavaScript that actually generates and controls DOM (i.e. html elements) in Runtime. Currently, there's no way around it - you have to have Javascript enabled in the browser to make it work, there is a theoretical possibility to generate some HTML server-side but it's not implemented yet.
+You can serve static html page and everything from any HTTP(S) server but currently it will try to access /api/ path at same domain it's running on, meaning that as of right now you cannot put it on one domain and access the other without proxying requests.
+Development server does exactly that - it serves static html page with javascript and all other assets, adds some code to automatically reload when changes to code are made and proxies requests to some other server.
+Setting up development server is fairly straight-forward.
+cd
into it and run yarn
to fetch dependencies.config/local.example.json
to config/local.json
and change the target
to point at instance you want, otherwise it will point to localhost:4000
which is default address for locally-run Pleroma Backendyarn dev
- it will start the server.localhost:8080
in your browser, it might take a while initially until everything is built first time.This could be a bit trickier, you basically need steps 1-4 from develop build instructions, and run yarn build
which will compile and copy eveything needed for production into dist
folder. As said before, this technically could be used anywhere with some details.
This is the most easiest way to use and test FE build: you just need to copy or symlink contents of dist
folder into backend's static directory, by default it is located in instance/static
, or in /var/lib/pleroma/static
for OTP release installations, create it if it doesn't exist already. Be aware that running yarn build
wipes the contents of dist
folder.
This is highly experimental and only tried once, with no actual simple solution available yet
+You will need an HTTP server that can proxy requests for /api
, /instance
, /nodeinfo
and show index.html for every 404 page.
For nginx you'll probably need something like this:
+server {
+ listen 80 default_server;
+
+ index index.html index.htm index.nginx-debian.html;
+
+ root /var/www/html
+
+ location /api {
+ proxy_pass https://example.tld;
+ }
+
+ location /instance {
+ proxy_pass https://example.tld;
+ }
+
+ location /nodeinfo {
+ proxy_pass https://example.tld;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+}
+
(ed. note: this is close to what i used last time i had to do it, it may not work and need additions, i basically adjusted default nginx server in debian)
+In 99% cases PleromaFE uses MastoAPI with Pleroma Extensions to fetch the data. The rest is either QvitterAPI leftovers or pleroma-exclusive APIs. QvitterAPI doesn't exactly have documentation and uses different JSON structure and sometimes different parameters and workflows, this could be a good reference though. Some pleroma-exclusive API may still be using QvitterAPI JSON structure.
+PleromaFE supports both formats by transforming them into internal format which is basically QvitterAPI one with some additions and renaming. All data is passed trough Entity Normalizer which can serve as a reference of API and what's actually used, it's also a host for all the hacks and data transformation.
+For most part, PleromaFE tries to store all the info it can get in global vuex store - every user and post are passed trough updating mechanism where data is either added or merged with existing data, reactively updating the information throughout UI, so if in newest request user's post counter increased, it will be instantly updated in open user profile cards. This is also used to find users, posts and sometimes to build timelines and/or request parameters.
+PleromaFE also tries to persist this store, however only stable data is stored, such as user authentication and preferences, user highlights. Persistence is performed by saving and loading chunk of vuex store in browser's LocalStorage/IndexedDB.
+TODO: Refactor API code and document it here
+PleromaFE uses custom theme "framework" which is pretty much just a style tag rendered by vue which only contains CSS3 variables. Every color used in UI should be derived from theme. Theme is stored in a JSON object containing color, opacity, shadow and font information, with most of it being optional.
+The most basic theme can consist of 4 to 8 "basic colors", which is also what previous version of themes allowed, with all other colors being derived from those basic colors, i.e. "light background" will be "background" color lightened/darkened, "panel header" will be same as "foreground". The idea is that you can specify just basic color palette and everything else will be generated automatically, but if you really need to tweak some specific color - you can.
+As said before - older version only allowed 4 to 8 colors, it also used arrays instead of objects, we still support that. The basic colors are: background, foreground, text, links, red, orange, blue, green. First 4 are mandatory, last 4 have default fallbacks since ever more ancient theme formats only had 4 colors.
+Note that with older version themes used different internal naming when persisting state.
+Themes are meant to be backwards and somewhat forwards compatible - new colors should properly inherit from some existing one, making it compatible with older versions. When loading newer version of theme all unrecognized colors will be ignored, which for most part should be fine, however adding new features (gradients, masks, whatever it might be) might be breaky.
+Lastly, pleroma provides some contrast information and generates readable text color automatically, which is done by tracking background/text color pairs and their contrast - if contrast too low it will try to use background color with inverted lightness, if it's still unacceptable it will fall back to pure black/white.
+Most images are wrapped in a component called StillImage, which does one simple thing - tries to detect if image is a GIF and if it is (and user has enabled relevant setting) it will show <canvas>
with that image instead of actual image. It uses standard method to render an image into canvas which renders first frame of a GIF if it's animated (obviously because canvas by itself isn't animated and you'd need to animate it yourself in JS), it will show actual image on hover. Statuses also allow playing animated avatars when you hover over a post, not just image itself.
Feel free to contribute, most preferred way is by starting a Merge Request in GitLab. Please try to use descriptive names for your branches and merge requests, avoid naming them "fix-issue-777" "777" and so on.
+ + +\n {translation(\"search.result.term.missing\")}: {...missing}\n
\n }\n