Skip to content

Commit

Permalink
Add additional default content types, improve formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
HowardWolosky committed Jul 18, 2020
1 parent 3c02496 commit 640306c
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 90 deletions.
14 changes: 7 additions & 7 deletions Formatters/GitHubReleases.Format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
<Label>Committish</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Is Draft</Label>
<Label>Draft</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Is PreRelease</Label>
<Label>PreRelease</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Creation Date</Label>
<Label>Created</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Published Date</Label>
<Label>Published</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
Expand Down Expand Up @@ -90,13 +90,13 @@
<Label>Content Type</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Download Count</Label>
<Label>Downloads</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Creation Date</Label>
<Label>Created</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Updated Date</Label>
<Label>Updated</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
Expand Down
172 changes: 89 additions & 83 deletions GitHubCore.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1124,90 +1124,96 @@ function Get-MediaAcceptHeader

# Compiled mostly from https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
extensionToContentType = @{
'.3gp' = 'video/3gpp' # 3GPP audio/video container
'.3g2' = 'video/3gpp2' # 3GPP2 audio/video container
'.7z' = 'application/x-7z-compressed' # 7-zip archive
'.aac' = 'audio/aac' # AAC audio
'.abw' = 'application/x-abiword' # AbiWord document
'.arc' = 'application/x-freearc' # Archive document (multiple files embedded)
'.avi' = 'video/x-msvideo' # AVI: Audio Video Interleave
'.azw' = 'application/vnd.amazon.ebook' # Amazon Kindle eBook format
'.bin' = 'application/octet-stream' # Any kind of binary data
'.bmp' = 'image/bmp' # Windows OS/2 Bitmap Graphics
'.bz' = 'application/x-bzip' # BZip archive
'.bz2' = 'application/x-bzip2' # BZip2 archive
'.csh' = 'application/x-csh' # C-Shell script
'.css' = 'text/css' # Cascading Style Sheets (CSS)
'.csv' = 'text/csv' # Comma-separated values (CSV)
'.doc' = 'application/msword' # Microsoft Word
'.docx' = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' # Microsoft Word (OpenXML)
'.eot' = 'application/vnd.ms-fontobject' # MS Embedded OpenType fonts
'.epub' = 'application/epub+zip' # Electronic publication (EPUB)
'.exe' = 'application/vnd.microsoft.portable-executable' # Microsoft application executable
'.gz' = 'application/gzip' # GZip Compressed Archive
'.gif' = 'image/gif' # Graphics Interchange Format (GIF)
'.htm' = 'text/html' # HyperText Markup Language (HTML)
'.html' = 'text/html' # HyperText Markup Language (HTML)
'.ico' = 'image/vnd.microsoft.icon' # Icon format
'.ics' = 'text/calendar' # iCalendar format
'.ini' = 'text/plain' # Text-based configuration file
'.jar' = 'application/java-archive' # Java Archive (JAR)
'.jpeg' = 'image/jpeg' # JPEG images
'.jpg' = 'image/jpeg' # JPEG images
'.js' = 'text/javascript' # JavaScript
'.json' = 'application/json' # JSON format
'.3gp' = 'video/3gpp' # 3GPP audio/video container
'.3g2' = 'video/3gpp2' # 3GPP2 audio/video container
'.7z' = 'application/x-7z-compressed' # 7-zip archive
'.aac' = 'audio/aac' # AAC audio
'.abw' = 'application/x-abiword' # AbiWord document
'.arc' = 'application/x-freearc' # Archive document (multiple files embedded)
'.avi' = 'video/x-msvideo' # AVI: Audio Video Interleave
'.azw' = 'application/vnd.amazon.ebook' # Amazon Kindle eBook format
'.bin' = 'application/octet-stream' # Any kind of binary data
'.bmp' = 'image/bmp' # Windows OS/2 Bitmap Graphics
'.bz' = 'application/x-bzip' # BZip archive
'.bz2' = 'application/x-bzip2' # BZip2 archive
'.csh' = 'application/x-csh' # C-Shell script
'.css' = 'text/css' # Cascading Style Sheets (CSS)
'.csv' = 'text/csv' # Comma-separated values (CSV)
'.deb' = 'application/octet-stream' # Standard Uix archive format
'.doc' = 'application/msword' # Microsoft Word
'.docx' = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' # Microsoft Word (OpenXML)
'.eot' = 'application/vnd.ms-fontobject' # MS Embedded OpenType fonts
'.epub' = 'application/epub+zip' # Electronic publication (EPUB)
'.exe' = 'application/vnd.microsoft.portable-executable' # Microsoft application executable
'.gz' = 'application/x-gzip' # GZip Compressed Archive
'.gif' = 'image/gif' # Graphics Interchange Format (GIF)
'.htm' = 'text/html' # HyperText Markup Language (HTML)
'.html' = 'text/html' # HyperText Markup Language (HTML)
'.ico' = 'image/vnd.microsoft.icon' # Icon format
'.ics' = 'text/calendar' # iCalendar format
'.ini' = 'text/plain' # Text-based configuration file
'.jar' = 'application/java-archive' # Java Archive (JAR)
'.jpeg' = 'image/jpeg' # JPEG images
'.jpg' = 'image/jpeg' # JPEG images
'.js' = 'text/javascript' # JavaScript
'.json' = 'application/json' # JSON format
'.jsonld' = 'application/ld+json' # JSON-LD format
'.mid' = 'audio/midi' # Musical Instrument Digital Interface (MIDI)
'.midi' = 'audio/midi' # Musical Instrument Digital Interface (MIDI)
'.mjs' = 'text/javascript' # JavaScript module
'.mp3' = 'audio/mpeg' # MP3 audio
'.mp4' = 'video/mp4' # MP3 video
'.mov' = 'video/quicktime' # Quicktime video
'.mpeg' = 'video/mpeg' # MPEG Video
'.mpg' = 'video/mpeg' # MPEG Video
'.mpkg' = 'application/vnd.apple.installer+xml' # Apple Installer Package
'.mkv' = 'video/x-matroska' # Matroska Multimedia Container
'.odp' = 'application/vnd.oasis.opendocument.presentation' # OpenDocument presentation document
'.ods' = 'application/vnd.oasis.opendocument.spreadsheet' # OpenDocument spreadsheet document
'.odt' = 'application/vnd.oasis.opendocument.text' # OpenDocument text document
'.oga' = 'audio/ogg' # OGG audio
'.ogg' = 'application/ogg' # OGG audio or video
'.ogv' = 'video/ogg' # OGG video
'.ogx' = 'application/ogg' # OGG
'.opus' = 'audio/opus' # Opus audio
'.otf' = 'font/otf' # OpenType font
'.png' = 'image/png' # Portable Network Graphics
'.pdf' = 'application/pdf' # Adobe Portable Document Format (PDF)
'.php' = 'application/x-httpd-php' # Hypertext Preprocessor (Personal Home Page)
'.ps1' = 'text/plain' # PowerShell script file
'.psd1' = 'text/plain' # PowerShell module definition file
'.psm1' = 'text/plain' # PowerShell module file
'.ppt' = 'application/vnd.ms-powerpoint' # Microsoft PowerPoint
'.pptx' = 'application/vnd.openxmlformats-officedocument.presentationml.presentation' # Microsoft PowerPoint (OpenXML)
'.rar' = 'application/vnd.rar' # RAR archive
'.rtf' = 'application/rtf' # Rich Text Format (RTF)
'.sh' = 'application/x-sh' # Bourne shell script
'.svg' = 'image/svg+xml' # Scalable Vector Graphics (SVG)
'.swf' = 'application/x-shockwave-flash' # Small web format (SWF) or Adobe Flash document
'.tar' = 'application/x-tar' # Tape Archive (TAR)
'.tif' = 'image/tiff' # Tagged Image File Format (TIFF)
'.tiff' = 'image/tiff' # Tagged Image File Format (TIFF)
'.ts' = 'video/mp2t' # MPEG transport stream
'.ttf' = 'font/ttf' # TrueType Font
'.txt' = 'text/plain' # Text (generally ASCII or ISO 8859-n)
'.vsd' = 'application/vnd.visio' # Microsoft Visio
'.wav' = 'audio/wav' # Waveform Audio Format
'.weba' = 'audio/webm' # WEBM audio
'.webm' = 'video/webm' # WEBM video
'.webp' = 'image/webp' # WEBP image
'.woff' = 'font/woff' # Web Open Font Format (WOFF)
'.woff2' = 'font/woff2' # Web Open Font Format (WOFF)
'.xhtml' = 'application/xhtml+xml' # XHTML
'.xls' = 'application/vnd.ms-excel' # Microsoft Excel
'.xlsx' = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' # Microsoft Excel (OpenXML)
'.xml' = 'application/xml' # XML
'.xul' = 'application/vnd.mozilla.xul+xml' # XUL
'.zip' = 'application/zip' # ZIP archive
'.mid' = 'audio/midi' # Musical Instrument Digital Interface (MIDI)
'.midi' = 'audio/midi' # Musical Instrument Digital Interface (MIDI)
'.mjs' = 'text/javascript' # JavaScript module
'.mp3' = 'audio/mpeg' # MP3 audio
'.mp4' = 'video/mp4' # MP3 video
'.mov' = 'video/quicktime' # Quicktime video
'.mpeg' = 'video/mpeg' # MPEG Video
'.mpg' = 'video/mpeg' # MPEG Video
'.mpkg' = 'application/vnd.apple.installer+xml' # Apple Installer Package
'.msi' = 'application/octet-stream' # Windows Installer package
'.msix' = 'application/octet-stream' # Windows Installer package
'.mkv' = 'video/x-matroska' # Matroska Multimedia Container
'.odp' = 'application/vnd.oasis.opendocument.presentation' # OpenDocument presentation document
'.ods' = 'application/vnd.oasis.opendocument.spreadsheet' # OpenDocument spreadsheet document
'.odt' = 'application/vnd.oasis.opendocument.text' # OpenDocument text document
'.oga' = 'audio/ogg' # OGG audio
'.ogg' = 'application/ogg' # OGG audio or video
'.ogv' = 'video/ogg' # OGG video
'.ogx' = 'application/ogg' # OGG
'.opus' = 'audio/opus' # Opus audio
'.otf' = 'font/otf' # OpenType font
'.png' = 'image/png' # Portable Network Graphics
'.pdf' = 'application/pdf' # Adobe Portable Document Format (PDF)
'.php' = 'application/x-httpd-php' # Hypertext Preprocessor (Personal Home Page)
'.pkg' = 'application/octet-stream' # mac OS X installer file
'.ps1' = 'text/plain' # PowerShell script file
'.psd1' = 'text/plain' # PowerShell module definition file
'.psm1' = 'text/plain' # PowerShell module file
'.ppt' = 'application/vnd.ms-powerpoint' # Microsoft PowerPoint
'.pptx' = 'application/vnd.openxmlformats-officedocument.presentationml.presentation' # Microsoft PowerPoint (OpenXML)
'.rar' = 'application/vnd.rar' # RAR archive
'.rtf' = 'application/rtf' # Rich Text Format (RTF)
'.rpm' = 'application/octet-stream' # Red Hat Linux package format
'.sh' = 'application/x-sh' # Bourne shell script
'.svg' = 'image/svg+xml' # Scalable Vector Graphics (SVG)
'.swf' = 'application/x-shockwave-flash' # Small web format (SWF) or Adobe Flash document
'.tar' = 'application/x-tar' # Tape Archive (TAR)
'.tif' = 'image/tiff' # Tagged Image File Format (TIFF)
'.tiff' = 'image/tiff' # Tagged Image File Format (TIFF)
'.ts' = 'video/mp2t' # MPEG transport stream
'.ttf' = 'font/ttf' # TrueType Font
'.txt' = 'text/plain' # Text (generally ASCII or ISO 8859-n)
'.vsd' = 'application/vnd.visio' # Microsoft Visio
'.vsix' = 'application/zip' # Visual Studio application package archive
'.wav' = 'audio/wav' # Waveform Audio Format
'.weba' = 'audio/webm' # WEBM audio
'.webm' = 'video/webm' # WEBM video
'.webp' = 'image/webp' # WEBP image
'.woff' = 'font/woff' # Web Open Font Format (WOFF)
'.woff2' = 'font/woff2' # Web Open Font Format (WOFF)
'.xhtml' = 'application/xhtml+xml' # XHTML
'.xls' = 'application/vnd.ms-excel' # Microsoft Excel
'.xlsx' = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' # Microsoft Excel (OpenXML)
'.xml' = 'application/xml' # XML
'.xul' = 'application/vnd.mozilla.xul+xml' # XUL
'.zip' = 'application/zip' # ZIP archive
}
}.GetEnumerator() | ForEach-Object {
Set-Variable -Scope Script -Option ReadOnly -Name $_.Key -Value $_.Value
Expand Down

0 comments on commit 640306c

Please sign in to comment.