Превращайте фрагменты C в изображения, которыми хочется делиться, не покидая Mac.
C snippets are usually posted to make a precise point about memory or pointers, so every character matters.
Codeshot определяет C по вставленному коду, так что ошибиться с выбором языка невозможно. Вот один и тот же фрагмент в трёх из 30 встроенных тем, отрисованных стилями самого приложения.
#include<stdlib.h>typedefstruct {char *code;
int scale;
} Snapshot;
intsnapshot_export(const Snapshot *s, constchar *path) {
if (s == NULL || path == NULL) return-1;
return render_and_save(s->code, path, s->scale);
}
GitHub · тёмная
#include<stdlib.h>typedefstruct {char *code;
int scale;
} Snapshot;
intsnapshot_export(const Snapshot *s, constchar *path) {
if (s == NULL || path == NULL) return-1;
return render_and_save(s->code, path, s->scale);
}
Solarized · тёмная
#include<stdlib.h>typedefstruct {char *code;
int scale;
} Snapshot;
intsnapshot_export(const Snapshot *s, constchar *path) {
if (s == NULL || path == NULL) return-1;
return render_and_save(s->code, path, s->scale);
}
Tokyo Night · тёмная
Как выбрать тему для C
Pointer punctuation is easy to lose at small sizes. Push the font up and trim the snippet rather than fitting more in.
Как выбрать размер
Пусть размер следует за содержимым или зафиксируйте соотношение — 1:1, 4:3, 3:2, 16:9, 9:16, 2:3 или 3:4 — а затем экспортируйте в 1×, 2× или 3×, чтобы изображение оставалось чётким на retina-экране. Скопируйте его в буфер обмена сочетанием ⌘⇧C или сохраните через ⌘S.