commands.org
... ...
@@ -265,7 +265,7 @@ pluck import-block bad-websites.txt
265 265
* mety
266 266
Usage: ~pluck mety .<extension>~
267 267
268
- Prints the media type for the specified extension.
268
+ Prints the [[media-types][media type]] for the specified extension.
269 269
270 270
** Examples
271 271
#+BEGIN_EXAMPLE
... ...
@@ -278,6 +278,8 @@ pluck mety .css
278 278
#+END_EXAMPLE
279 279
which tells you that the media type of CSS files is ~text/css~.
280 280
281
+ /See also: [[media-types][Media types]]/
282
+
281 283
* more-help
282 284
Usage: ~pluck --more-help~ or ~pluck more-help~
283 285
media-types.org
... ...
@@ -1,28 +1,49 @@
1 1
---
2
-title: Pluckeye Media Types (aka MIME types)
2
+title: Media Types | Pluckeye
3 3
---
4 4
5 5
* Overview
6 6
7
-Internet Media Types are small strings that describe the type of some
8
-digital content. Some example media types are:
7
+ Internet media types (aka MIME types) are small strings that describe the type of some digital content. Some example media types are:
9 8
10 9
- text/html
11
-- text/plain
12 10
- image/jpeg
13 11
- video/mp4
14 12
15
-As you can see, the general format is:
13
+ As you can see, the general format is: ~<major_type>/<minor_type>~
16 14
17
- major_type / minor_type
15
+ There are hundreds of media types.
18 16
19
-There are hundreds of media types.
17
+* Allowing / blocking
18
+ Media types can be specified in Pluckeye [[rules]] to allow or block certain types of content. Here are some examples of [[commands]] you could use to add such rules:
19
+
20
+ To allow all images on Facebook:
21
+#+BEGIN_EXAMPLE
22
+pluck + allow facebook.com image/
23
+#+END_EXAMPLE
24
+
25
+ To allow SVG images everywhere:
26
+#+BEGIN_EXAMPLE
27
+pluck + allow image/svg
28
+#+END_EXAMPLE
29
+
30
+ To block Adobe Flash on a particular page:
31
+#+BEGIN_EXAMPLE
32
+pluck + block https://example.com/foo.html application/x-shockwave-flash
33
+#+END_EXAMPLE
34
+
35
+ The general format of these commands is:
36
+#+BEGIN_EXAMPLE
37
+pluck <+ / -> <rule type> [host / url / ip address / port] <media type>
38
+#+END_EXAMPLE
39
+
40
+ (See the [[rules][Rules]] page to understand what the terms in the general form mean.)
20 41
21 42
* Major types
22 43
23 44
There are only a handful of useful major media types:
24 45
25
- - application :: the largest major media type, it has hundreds of sub-types.
46
+ - application :: the largest major media type, having hundreds of sub-types
26 47
- audio :: audio content
27 48
- font :: a relatively young type used for new fonts
28 49
- image :: image content
... ...
@@ -31,25 +52,40 @@ There are hundreds of media types.
31 52
32 53
* Noteworthy types
33 54
34
- - application/octet-stream :: a catch-all for binary content
35
- - text/html :: web pages
36
- - text/css :: stylesheets on web pages
37
- - text/plain :: plain text (not too common on the web)
38
- - application/javascript :: the most common label for javascript
39
- - image/png :: the most common type of image
40
- - video/mp4 :: an example of the type of an mp4 video
41
- - todo :: lots more...
42
-
43
-* Application
44
-
45
- doc, pdf, zip, etc.
46
-
47
- TODO fill me in
48
-
49
-* Querying for media type
50
-
55
+** application
56
+ - application/javascript :: The most common label for JavaScript.
57
+ - application/msword :: Old Microsoft Word documents (~.doc~).
58
+ - application/octet-stream :: A catch-all for binary content.
59
+ - application/pdf :: Most PDF files.
60
+ - application/vnd.ms-powerpoint :: Old Microsoft PowerPoint presentations (~.ppt~).
61
+ - application/vnd.openxmlformats-officedocument.presentationml.presentation :: Microsoft PowerPoint presentations (~.pptx~).
62
+ - application/vnd.openxmlformats-officedocument.wordprocessingml.document :: Microsoft Word documents (~.docx~)
63
+ - application/x-shockwave-flash :: Adobe Flash.
64
+ - application/x-silverlight :: Microsoft Silverlight.
65
+ - application/zip :: ZIP files.
66
+
67
+** image
68
+ - image/png :: The most common type of image.
69
+ - image/svg :: [[https://en.wikipedia.org/wiki/Scalable_Vector_Graphics][SVG images]], which are not taken by cameras, but are created using gemoetric shapes. As such, they are not a concern for most who wish to avoid problematic images online.
70
+ - image/vnd.microsoft.icon :: You know those little images that appear in your browser tabs and bookmarks? Those are generally this type.
71
+
72
+** text
73
+ - text/css :: Stylesheets on web pages.
74
+ - text/html :: Normal web pages.
75
+ - text/plain :: Plain text (not too common on the web).
76
+
77
+** audio / video
78
+ - audio/mpeg :: MP3 files.
79
+ - video/mp4 :: MP4 video files.
80
+
81
+* Finding a media type
82
+
83
+ You can determine the media type of a particular file using the [[commands#mety][mety command]]:
51 84
#+BEGIN_SRC sh
52 85
$ pluck mety foo.txt
53 86
foo.txt -> text/plain
54 87
#+END_SRC
55 88
89
+* More media types
90
+ - The MDN Web Docs have a [[https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types][longer list of common media types]], which they refer to as /MIME types/.
91
+ - Wikipedia has [[https://en.wikipedia.org/wiki/Media_type][an article about media types]].
rules.org
... ...
@@ -181,32 +181,7 @@ pluck + block [::1234]
181 181
#+END_EXAMPLE
182 182
183 183
** Media types
184
- Console usage: ~pluck <+ / -> <rule type> [host / url / ip address / port] <media type>~
185
-
186
- To block all images:
187
-#+BEGIN_EXAMPLE
188
-pluck + block image/
189
-#+END_EXAMPLE
190
-
191
- [[https://en.wikipedia.org/wiki/Scalable_Vector_Graphics][SVG images]] are not taken by cameras, but are created using gemoetric shapes. As such, they are not a concern for most who wish to avoid problematic images online. To allow SVG images:
192
-#+BEGIN_EXAMPLE
193
-pluck + allow image/svg
194
-#+END_EXAMPLE
195
-
196
- To block Adobe Flash:
197
-#+BEGIN_EXAMPLE
198
-pluck + block application/x-shockwave-flash
199
-#+END_EXAMPLE
200
-
201
- To block JavaScript:
202
-#+BEGIN_EXAMPLE
203
-pluck + block application/javascript
204
-#+END_EXAMPLE
205
-
206
- To block Microsoft Silverlight:
207
-#+BEGIN_EXAMPLE
208
-pluck + block application/x-silverlight
209
-#+END_EXAMPLE
184
+ /Main article: [[media-types][Media types]]/
210 185
211 186
** Ports
212 187
Console usage: ~pluck <+ / -> <rule type> [ip address] port <port number>~