นี่คือซอร์สโค้ดสำหรับเว็บไซต์แกลเลอรี่ Themacs Themes
ในการเพิ่มธีมใหม่คุณต้องสร้างไฟล์อย่างน้อย 4 ไฟล์:
.json ซึ่งเป็นสูตรจริงของธีม;.png ขนาดเล็ก ซึ่งเป็นภาพที่แสดงในหน้าด้านหน้าและดัชนี.png ขนาดใหญ่ ซึ่งจะแสดงอยู่ในหน้าธีม เพิ่มไฟล์ 400x200 .png ไปที่ /รูท/สินทรัพย์/imgs-small ไดเรกทอรี นี่จะเป็นภาพขนาดเล็กที่แสดงในหน้าแรกหรือหน้าดัชนี คุณจะต้องเพิ่มชื่อนี้ลงในไฟล์สูตร
เพิ่มจำนวนไฟล์ .png (ภาพหน้าจอ) ที่คุณต้องการ /รูท/สินทรัพย์/IMGS ไดเรกทอรี สิ่งเหล่านี้จะแสดงในหน้าธีม คุณจะต้องเพิ่มชื่อนี้ลงในไฟล์สูตร
เพิ่มไฟล์ .el ไปยัง /root/assets/local-SRC Directory คุณสามารถตั้งชื่อได้ตามที่คุณต้องการ แต่ฉันขอแนะนำให้ใช้ชื่อของแบบฟอร์ม: [theme-name]-theme-source-code.el คุณจะต้องเพิ่มชื่อนี้ลงในไฟล์สูตร
เพิ่มไฟล์ .json ไปยังไดเรกทอรี /สูตรอาหาร คุณสามารถตั้งชื่อตามที่คุณต้องการ แต่ฉันขอแนะนำให้ตั้งชื่อเป็นธีมของคุณ ไฟล์ต้องมีโครงสร้างนี้:
{
"name" : "[Theme Name]" ,
"description" : "[Some description]" ,
"remoteSrc" : "[Source code source]" ,
"localSrc" : "./assets/local-src/[name of the source code file from /root/assets/local-src]" ,
"author" : "[Name of the Author/s]" ,
"largeImgs" : [
"./assets/imgs/[large-img1-name]" ,
"./assets/imgs/[large-img2-name]" ,
] ,
"tags" : [
"[tag1]" ,
"[tag2]" ,
] ,
"available" : "[true or false (depending on whether the theme is submitted to MELPA)] " ,
"smallImg" : "./assets/imgs-small/[small-img-name]"
}นี่คือตัวอย่างเกี่ยวกับลักษณะของไฟล์สูตรปกติ:
{
"name" : "Solarized Themes" ,
"description" : "Solarized for Emacs is an Emacs port of the Solarized theme for vim, developed by Ethan Schoonover." ,
"remoteSrc" : "https://github.com/bbatsov/solarized-emacs" ,
"localSrc" : "./assets/local-src/solarized-themes-source-code.el" ,
"author" : "Bozhidar Batsov & Thomas Fru00f6ssman" ,
"largeImgs" : [
"./assets/imgs/solarized-dark.png" ,
"./assets/imgs/solarized-dark-bis.png" ,
"./assets/imgs/solarized-light.png" ,
"./assets/imgs/solarized-light-bis.png"
] ,
"tags" : [
"dark" ,
"emacs 23" ,
"light" ,
"popular" ,
"solarized"
] ,
"available" : true ,
"smallImg" : "./assets/imgs-small/solarized-dark.png"
}