Skip to content

Instantly share code, notes, and snippets.

View waltergu's full-sized avatar
🎯
Focusing

Zhao-Long Gu waltergu

🎯
Focusing
View GitHub Profile
@waltergu
waltergu / gist:dda6687109046f8ad4775e9bb6be6489
Created November 1, 2018 04:25
Add a icon to the title of the html pages generated by Documenter.jl
1. Rename your icon file as "favicon.ico", place it in the "YourPackage/docs/src/assets/" folder;
2. In the "YourPackage/docs/src/make.jl" file, add a keyword argument "asserts=["assets/favicon.ico"]" to the "makedocs" function.
1. Prepare the original picture with a square resolution > 512x512 in the bmp/png format.
2. Install a software that can modify the resolution and convert the format of pictures, especially, can generate icon files. "ImageMagic" is recommeded which supports multiplatforms. [http://www.imagemagick.org/script/index.php]
3. Generate pictures with different resolutions (16x16,32x32,64x64,128x128,256x256,512x512) of the original one, and combine them to be an icon file. For "ImageMagic", just run the following commands (assume the original picture is "logo.bmp"):
convert logo.bmp -resize 512x512 logo512.bmp
convert logo.bmp -resize 256x256 logo256.bmp
convert logo.bmp -resize 128x128 logo128.bmp
convert logo.bmp -resize 64x64 logo64.bmp
convert logo.bmp -resize 32x32 logo32.bmp
convert logo.bmp -resize 16x16 logo16.bmp
convert logo16.bmp logo32.bmp logo64.bmp logo128.bmp logo256.bmp logo512.bmp logo.ico