#yaml #jekyll
#yaml #джекилл
Вопрос:
Я использую jekyll 4.1.1 на Win10 для создания академического веб-сайта, разветвленного на: https://github.com/sbryngelson/sbryngelson.github.io . Я читаю файл .yml, в котором перечислены ссылки на публикации. По-видимому, все элементы одинаково отформатированы, но в какой-то момент я получаю следующую ошибку после запуска «bundle exec jekyll serve —trace»:
не найден ожидаемый ключ при анализе сопоставления блоков в строке 111, столбец 3 (Psych::SyntaxError)
Если я перейду к файлу в точной строке, которую я нашел:
- title: "Integrated multiplatform method for in vitro quantitative assessment of cellular uptake for fluorescent polymer nanoparticles"
authors: "R.Ferrari, M.Lupi, F.Falcetta, P.Bigini, K.Paolella, F.Fiordaliso, C.Bisighini, M.Salmona, M.D'Incalci, M.Morbidelli, D.Moscatelli, P.Ubezio"
url:
image:
journal: "Nanotechnology"
info: "24398665"
year: "2014"
doi: "10.1088/0957-4484/25/4/045102"
abstract: "Studies of cellular internalization of nanoparticles (NPs) play a paramount role for the design of efficient drug delivery systems, but so far they lack a robust experimental technique able to quantify the NP uptake in terms of number of NPs internalized in each cell. In this work we propose a novel method which provides a quantitative evaluation of fluorescent NP uptake by combining flow cytometry and plate fluorimetry with measurements of number of cells. Single cell fluorescence signals measured by flow cytometry were associated with the number of internalized NPs, exploiting the observed linearity between average flow cytometric fluorescence and overall plate fluorimeter measures, and previous calibration of the microplate reader with serial dilutions of NPs. This precise calibration has been made possible by using biocompatible fluorescent NPs in the range of 20-300 nm with a narrow particle size distribution, functionalized with a covalently bonded dye, Rhodamine B, and synthesized via emulsion free-radical polymerization. We report the absolute number of NPs internalized in mouse mammary tumor cells (4T1) as a function of time for different NP dimensions and surface charges and at several exposure concentrations. The obtained results indicate that 4T1 cells incorporated 103-104 polymer NPs in a short time, reaching an intracellular concentration 15 times higher than the external one. © 2014 IOP Publishing Ltd."
- title: "Modeling of large-scale horizontal reactor for silicon epitaxy"
authors: "A.Veneroni, D.Moscatelli, M.Masi"
url:
image:
journal: "Journal of Crystal Growth"
info: ""
year: "2005"
doi: "10.1016/j.jcrysgro.2004.10.108"
abstract: "A detailed 3D simulation of a large-scale industrial cold-wall horizontal reactor for epitaxial silicon deposition is presented. Simulations showed that realistic inlet jets description is necessary to obtain a reliable picture of the system. Different chamber geometries are analyzed with the aim of reducing the "memory effects" during the dopant switching in junction production inside the same reactor chamber without wafers loading and unloading. Configurations inducing a graded gas expansion have been identified as contributing to the solution of the problem. © 2004 Elsevier B.V. All rights reserved."
Строка 111 — это строка со вторым заголовком: т.е. — заголовок: «Моделирование ….
Я скопировал и вставил также предыдущий элемент только для справки, поскольку он читается без ошибок.
Я понял, что такого рода ошибки возникают, когда в файле присутствуют некоторые дополнительные символы или текст имеет плохой отступ. В этой ситуации оба случая не проверяются.
Это может быть тривиальной ошибкой, но я не могу представить решение. Я также пытался переместить объект выше в файле, но всегда получаю ту же ошибку в той же строке. Я также визуализировал все скрытые символы, но ничего.
Кто-нибудь может предложить мне решение? Спасибо.
Ответ №1:
При цитировании строк в YAML у вас есть в основном 5 разных способов.
В последней строке вашего примера вы используете двойные кавычки. Но двойные кавычки нельзя использовать без экранирования в самих двойных кавычках, и это то, что у вас есть:
abstract: "A detailed 3D simulation of a large-scale... "memory effects" ..."
Вы должны экранировать их с помощью обратной косой черты (см. Двойные кавычки)
abstract: "A detailed 3D simulation of a large-scale... "memory effects" ..."
Полученное сообщение об ошибке не очень полезно. Другие процессоры YAML могут предоставить лучшие и более правильное местоположение ошибки. Например, PyYAML сообщает правильную строку и местоположение.
Комментарии:
1. Очень полезно. Поскольку исходный файл был создан автоматически, поскольку в нем сотни элементов, я не обращал внимания на содержимое. Однако сообщение об ошибке вводит в заблуждение. большое спасибо.