<commit_before>div.full-size.pdf(ng-controller="PdfController")
	.toolbar.toolbar-tall
		a.btn.btn-info(
			href,
			ng-disabled="pdf.compiling",
			ng-click="recompile()"
		)
			i.fa.fa-refresh(
				ng-class="{'fa-spin': pdf.compiling }"
			)
			| &nbsp;&nbsp;
			span(ng-show="!pdf.compiling") Recompile
			span(ng-show="pdf.compiling") Compiling...
		a.log-btn(
			href
			ng-click="toggleLogs()"
			ng-class="{ 'active': (pdf.view == 'logs' || pdf.failure) && !pdf.error && !pdf.timeout && !pdf.uncompiled }"
			tooltip="Logs and output files"
			tooltip-placement="bottom"
		)
			i.fa.fa-file-text-o
			span.label(
				ng-show="pdf.logEntries.warnings.length + pdf.logEntries.errors.length > 0"
				ng-class="{\
					'label-warning': pdf.logEntries.errors.length == 0,\
					'label-danger': pdf.logEntries.errors.length > 0\
				}"
			) {{ pdf.logEntries.errors.length + pdf.logEntries.warnings.length }}
			
		.toolbar-right
			a(
				href,
				ng-click="switchToFlatLayout()"
				ng-show="ui.pdfLayout == 'sideBySide'"
				tooltip="Full screen"
				tooltip-placement="bottom"
				tooltip-append-to-body="true"
			)
				i.full-screen
			a(
				href,
				ng-click="switchToSideBySideLayout()"
				ng-show="ui.pdfLayout == 'flat'"
				tooltip="Split screen"
				tooltip-placement="bottom"
				tooltip-append-to-body="true"
			)
				i.split-screen
				i.split-screen

	.pdf-viewer(ng-show="pdf.url && pdf.view == 'pdf' && !pdf.failure && !pdf.timeout && !pdf.error")
		div(	
			pdfjs
			ng-if="settings.pdfViewer == 'pdfjs'"
			pdf-src="pdf.url"
			key="{{ project_id }}"
			resize-on="layout:main:resize,layout:pdf:resize"
			highlights="pdf.highlights"
			position="pdf.position"
			dbl-click-callback="syncToCode"
		)
		iframe(
			ng-src="{{ pdf.url }}"
			ng-if="settings.pdfViewer == 'native'"
		)

	.pdf-uncompiled(ng-show="pdf.uncompiled && !pdf.compiling")
		| &nbsp;
		i.fa.fa-level-up.fa-flip-horizontal.fa-2x
		| &nbsp;&nbsp;Click here to preview your work as a PDF.

	.pdf-errors(ng-show="pdf.timeout || pdf.error")
		.alert.alert-danger(ng-show="pdf.error")
			strong Server Error. 
			span Sorry, something went wrong and your project could not be compiled. Please try again in a few moments.

		.alert.alert-danger(ng-show="pdf.timeout")
			strong Timed out. 
			span Sorry, your compile was taking too long and timed out.
				| This may be due to a large number of high-res images, or lots of complicated diagrams. 
				| Please try to make your document simpler, or contact support for help.

	.pdf-logs(ng-show="(pdf.view == 'logs' || pdf.failure) && !pdf.error && !pdf.timeout && !pdf.uncompiled")
		.alert.alert-success(ng-show="pdf.logEntries.all.length == 0")
			| No errors, good job!

		.alert.alert-danger(ng-show="pdf.failure")
			strong Compile Error. 
			span Sorry, your LaTeX code couldn't compile for some reason. Please check the errors below for details, or view the raw log.

		div(ng-repeat="entry in pdf.logEntries.all", ng-controller="PdfLogEntryController")
			.alert(
				ng-class="{\
					'alert-danger':  entry.level == 'error',\
					'alert-warning': entry.level == 'warning',\
					'alert-info':    entry.level == 'typesetting'\
				}"
				ng-click="openInEditor(entry)"
			)
				span.line-no
					span(ng-show="entry.file") {{ entry.file }}
					span(ng-show="entry.line") , line {{ entry.line }}
				p.entry-message(ng-show="entry.message") {{ entry.message }}
				p.entry-content(ng-show="entry.content") {{ entry.content }}

		p<commit_msg>Show timedout errors properly<commit_after>div.full-size.pdf(ng-controller="PdfController")
	.toolbar.toolbar-tall
		a.btn.btn-info(
			href,
			ng-disabled="pdf.compiling",
			ng-click="recompile()"
		)
			i.fa.fa-refresh(
				ng-class="{'fa-spin': pdf.compiling }"
			)
			| &nbsp;&nbsp;
			span(ng-show="!pdf.compiling") Recompile
			span(ng-show="pdf.compiling") Compiling...
		a.log-btn(
			href
			ng-click="toggleLogs()"
			ng-class="{ 'active': (pdf.view == 'logs' || pdf.failure) && !pdf.error && !pdf.timeout && !pdf.uncompiled }"
			tooltip="Logs and output files"
			tooltip-placement="bottom"
		)
			i.fa.fa-file-text-o
			span.label(
				ng-show="pdf.logEntries.warnings.length + pdf.logEntries.errors.length > 0"
				ng-class="{\
					'label-warning': pdf.logEntries.errors.length == 0,\
					'label-danger': pdf.logEntries.errors.length > 0\
				}"
			) {{ pdf.logEntries.errors.length + pdf.logEntries.warnings.length }}
			
		.toolbar-right
			a(
				href,
				ng-click="switchToFlatLayout()"
				ng-show="ui.pdfLayout == 'sideBySide'"
				tooltip="Full screen"
				tooltip-placement="bottom"
				tooltip-append-to-body="true"
			)
				i.full-screen
			a(
				href,
				ng-click="switchToSideBySideLayout()"
				ng-show="ui.pdfLayout == 'flat'"
				tooltip="Split screen"
				tooltip-placement="bottom"
				tooltip-append-to-body="true"
			)
				i.split-screen
				i.split-screen

	.pdf-viewer(ng-show="pdf.url && pdf.view == 'pdf' && !pdf.failure && !pdf.timeout && !pdf.error")
		div(	
			pdfjs
			ng-if="settings.pdfViewer == 'pdfjs'"
			pdf-src="pdf.url"
			key="{{ project_id }}"
			resize-on="layout:main:resize,layout:pdf:resize"
			highlights="pdf.highlights"
			position="pdf.position"
			dbl-click-callback="syncToCode"
		)
		iframe(
			ng-src="{{ pdf.url }}"
			ng-if="settings.pdfViewer == 'native'"
		)

	.pdf-uncompiled(ng-show="pdf.uncompiled && !pdf.compiling")
		| &nbsp;
		i.fa.fa-level-up.fa-flip-horizontal.fa-2x
		| &nbsp;&nbsp;Click here to preview your work as a PDF.

	.pdf-errors(ng-show="pdf.timedout || pdf.error")
		.alert.alert-danger(ng-show="pdf.error")
			strong Server Error. 
			span Sorry, something went wrong and your project could not be compiled. Please try again in a few moments.

		.alert.alert-danger(ng-show="pdf.timedout")
			strong Timed out. 
			span Sorry, your compile was taking too long and timed out.
				| This may be due to a large number of high-res images, or lots of complicated diagrams. 
				| Please try to make your document simpler, or contact support for help.

	.pdf-logs(ng-show="(pdf.view == 'logs' || pdf.failure) && !pdf.error && !pdf.timeout && !pdf.uncompiled")
		.alert.alert-success(ng-show="pdf.logEntries.all.length == 0")
			| No errors, good job!

		.alert.alert-danger(ng-show="pdf.failure")
			strong Compile Error. 
			span Sorry, your LaTeX code couldn't compile for some reason. Please check the errors below for details, or view the raw log.

		div(ng-repeat="entry in pdf.logEntries.all", ng-controller="PdfLogEntryController")
			.alert(
				ng-class="{\
					'alert-danger':  entry.level == 'error',\
					'alert-warning': entry.level == 'warning',\
					'alert-info':    entry.level == 'typesetting'\
				}"
				ng-click="openInEditor(entry)"
			)
				span.line-no
					span(ng-show="entry.file") {{ entry.file }}
					span(ng-show="entry.line") , line {{ entry.line }}
				p.entry-message(ng-show="entry.message") {{ entry.message }}
				p.entry-content(ng-show="entry.content") {{ entry.content }}

		p
{'fraction_non_alphanumeric': 0.17062017719348385, 'fraction_numerical': 0.0014289797084881394, 'mean_word_length': 3.2418181818181817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '520553', 'n_tokens_mistral': 2896, 'n_tokens_neox': 2408, 'n_words': 470}